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
24 static UINT (WINAPI
*pMsiQueryComponentStateA
)
25 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
26 static UINT (WINAPI
*pMsiSourceListEnumSourcesA
)
27 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, DWORD
, LPSTR
, LPDWORD
);
28 static UINT (WINAPI
*pMsiSourceListGetInfoA
)
29 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, DWORD
, LPCSTR
, LPSTR
, LPDWORD
);
30 static INSTALLSTATE (WINAPI
*pMsiGetComponentPathExA
)
31 (LPCSTR
, LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPSTR
, LPDWORD
);
32 static UINT (WINAPI
*pMsiQueryFeatureStateExA
)
33 (LPCSTR
, LPCSTR
, MSIINSTALLCONTEXT
, LPCSTR
, INSTALLSTATE
*);
35 static BOOL (WINAPI
*pCheckTokenMembership
)(HANDLE
,PSID
,PBOOL
);
36 static BOOL (WINAPI
*pConvertSidToStringSidA
)(PSID
, LPSTR
*);
37 static BOOL (WINAPI
*pOpenProcessToken
)(HANDLE
, DWORD
, PHANDLE
);
38 static LONG (WINAPI
*pRegDeleteKeyExA
)(HKEY
, LPCSTR
, REGSAM
, DWORD
);
39 static BOOL (WINAPI
*pIsWow64Process
)(HANDLE
, PBOOL
);
41 static HMODULE hsrclient
;
42 static BOOL (WINAPI
*pSRRemoveRestorePoint
)(DWORD
);
43 static BOOL (WINAPI
*pSRSetRestorePointA
)(RESTOREPOINTINFOA
*, STATEMGRSTATUS
*);
46 static const BOOL is_64bit
= sizeof(void *) > sizeof(int);
48 static const char *msifile
= "msitest.msi";
49 static CHAR CURR_DIR
[MAX_PATH
];
50 static CHAR PROG_FILES_DIR
[MAX_PATH
];
51 static CHAR COMMON_FILES_DIR
[MAX_PATH
];
52 static CHAR APP_DATA_DIR
[MAX_PATH
];
53 static CHAR WINDOWS_DIR
[MAX_PATH
];
55 /* msi database data */
57 static const char component_dat
[] =
58 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
59 "s72\tS38\ts72\ti2\tS255\tS72\n"
60 "Component\tComponent\n"
61 "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
62 "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n"
63 "One\t{783B242E-E185-4A56-AF86-C09815EC053C}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"
64 "Three\t{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}\tCHANGEDDIR\t2\t\tthree.txt\n"
65 "Two\t{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}\tFIRSTDIR\t2\t\ttwo.txt\n"
66 "dangler\t{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}\tTARGETDIR\t4\t\tregdata\n"
67 "component\t\tMSITESTDIR\t0\t1\tfile\n"
68 "service_comp\t{935A0A91-22A3-4F87-BCA8-928FFDFE2353}\tMSITESTDIR\t0\t\tservice_file\n"
69 "service_comp2\t{3F7B04A4-9521-4649-BDC9-0C8722740A49}\tMSITESTDIR\t0\t\tservice_file2\n"
70 "service_comp3\t{DBCD1502-20E3-423F-B53E-F37E263CDC7E}\tMSITESTDIR\t0\t\t\n";
72 static const char directory_dat
[] =
73 "Directory\tDirectory_Parent\tDefaultDir\n"
75 "Directory\tDirectory\n"
76 "CABOUTDIR\tMSITESTDIR\tcabout\n"
77 "CHANGEDDIR\tMSITESTDIR\tchanged:second\n"
78 "FIRSTDIR\tMSITESTDIR\tfirst\n"
79 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
80 "NEWDIR\tCABOUTDIR\tnew\n"
81 "ProgramFilesFolder\tTARGETDIR\t.\n"
82 "TARGETDIR\t\tSourceDir";
84 static const char feature_dat
[] =
85 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
86 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
88 "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
89 "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n"
90 "One\t\tOne\tThe One Feature\t1\t3\tMSITESTDIR\t0\n"
91 "Three\t\tThree\tThe Three Feature\t3\t3\tCHANGEDDIR\t0\n"
92 "Two\t\tTwo\tThe Two Feature\t2\t3\tFIRSTDIR\t0\n"
93 "feature\t\t\t\t2\t1\tTARGETDIR\t0\n"
94 "service_feature\t\t\t\t2\t1\tTARGETDIR\t0";
96 static const char feature_comp_dat
[] =
97 "Feature_\tComponent_\n"
99 "FeatureComponents\tFeature_\tComponent_\n"
105 "feature\tcomponent\n"
106 "service_feature\tservice_comp\n"
107 "service_feature\tservice_comp2\n"
108 "service_feature\tservice_comp3";
110 static const char file_dat
[] =
111 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
112 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
114 "five.txt\tFive\tfive.txt\t1000\t\t\t16384\t5\n"
115 "four.txt\tFour\tfour.txt\t1000\t\t\t16384\t4\n"
116 "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"
117 "three.txt\tThree\tthree.txt\t1000\t\t\t0\t3\n"
118 "two.txt\tTwo\ttwo.txt\t1000\t\t\t0\t2\n"
119 "file\tcomponent\tfilename\t100\t\t\t8192\t1\n"
120 "service_file\tservice_comp\tservice.exe\t100\t\t\t8192\t6\n"
121 "service_file2\tservice_comp2\tservice2.exe\t100\t\t\t8192\t7";
123 static const char install_exec_seq_dat
[] =
124 "Action\tCondition\tSequence\n"
126 "InstallExecuteSequence\tAction\n"
127 "AllocateRegistrySpace\tNOT Installed\t1550\n"
128 "CostFinalize\t\t1000\n"
129 "CostInitialize\t\t800\n"
131 "ResolveSource\t\t950\n"
132 "MoveFiles\t\t1700\n"
133 "InstallFiles\t\t4000\n"
134 "DuplicateFiles\t\t4500\n"
135 "WriteEnvironmentStrings\t\t4550\n"
136 "CreateShortcuts\t\t4600\n"
137 "InstallServices\t\t5000\n"
138 "InstallFinalize\t\t6600\n"
139 "InstallInitialize\t\t1500\n"
140 "InstallValidate\t\t1400\n"
141 "LaunchConditions\t\t100\n"
142 "WriteRegistryValues\tSourceDir And SOURCEDIR\t5000";
144 static const char media_dat
[] =
145 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
146 "i2\ti4\tL64\tS255\tS32\tS72\n"
148 "1\t3\t\t\tDISK1\t\n"
149 "2\t7\t\tmsitest.cab\tDISK2\t\n";
151 static const char property_dat
[] =
154 "Property\tProperty\n"
155 "DefaultUIFont\tDlgFont8\n"
158 "InstallMode\tTypical\n"
159 "Manufacturer\tWine\n"
160 "PIDTemplate\t12345<###-%%%%%%%>@@@@@\n"
161 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
163 "ProductLanguage\t1033\n"
164 "ProductName\tMSITEST\n"
165 "ProductVersion\t1.1.1\n"
166 "PROMPTROLLBACKCOST\tP\n"
168 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
169 "AdminProperties\tPOSTADMIN\n"
171 "SERVNAME\tTestService\n"
172 "SERVNAME2\tTestService2\n"
173 "SERVDISP\tTestServiceDisp\n"
174 "SERVDISP2\tTestServiceDisp2\n"
175 "MSIFASTINSTALL\t1\n"
178 static const char environment_dat
[] =
179 "Environment\tName\tValue\tComponent_\n"
180 "s72\tl255\tL255\ts72\n"
181 "Environment\tEnvironment\n"
182 "Var1\t=-MSITESTVAR1\t1\tOne\n"
183 "Var2\tMSITESTVAR2\t1\tOne\n"
184 "Var3\t=-MSITESTVAR3\t1\tOne\n"
185 "Var4\tMSITESTVAR4\t1\tOne\n"
186 "Var5\t-MSITESTVAR5\t\tOne\n"
187 "Var6\tMSITESTVAR6\t\tOne\n"
188 "Var7\t!-MSITESTVAR7\t\tOne\n"
189 "Var8\t!-*MSITESTVAR8\t\tOne\n"
190 "Var9\t=-MSITESTVAR9\t\tOne\n"
191 "Var10\t=MSITESTVAR10\t\tOne\n"
192 "Var11\t+-MSITESTVAR11\t[~];1\tOne\n"
193 "Var12\t+-MSITESTVAR11\t[~];2\tOne\n"
194 "Var13\t+-MSITESTVAR12\t[~];1\tOne\n"
195 "Var14\t=MSITESTVAR13\t[~];1\tOne\n"
196 "Var15\t=MSITESTVAR13\t[~];2\tOne\n"
197 "Var16\t=MSITESTVAR14\t;1;\tOne\n"
198 "Var17\t=MSITESTVAR15\t;;1;;\tOne\n"
199 "Var18\t=MSITESTVAR16\t 1 \tOne\n"
200 "Var19\t+-MSITESTVAR17\t1\tOne\n"
201 "Var20\t+-MSITESTVAR17\t;;2;;[~]\tOne\n"
202 "Var21\t+-MSITESTVAR18\t1\tOne\n"
203 "Var22\t+-MSITESTVAR18\t[~];;2;;\tOne\n"
204 "Var23\t+-MSITESTVAR19\t1\tOne\n"
205 "Var24\t+-MSITESTVAR19\t[~]2\tOne\n"
206 "Var25\t+-MSITESTVAR20\t1\tOne\n"
207 "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"
208 "Var27\t+-MSITESTVAR21\t[~];1\tOne\n";
210 static const char service_install_dat
[] =
211 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
212 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
213 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
214 "ServiceInstall\tServiceInstall\n"
215 "TestService\t[SERVNAME]\t[SERVDISP]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService\t\t-a arg\tservice_comp\tdescription\n"
216 "TestService2\t[SERVNAME2]\t[SERVDISP2]\t2\t3\t0\t\tservice1[~]+group1[~]service2[~]+group2[~][~]\tTestService2\t\t-a arg\tservice_comp2\tdescription\n";
218 static const char service_install2_dat
[] =
219 "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t"
220 "LoadOrderGroup\tDependencies\tStartName\tPassword\tArguments\tComponent_\tDescription\n"
221 "s72\ts255\tL255\ti4\ti4\ti4\tS255\tS255\tS255\tS255\tS255\ts72\tL255\n"
222 "ServiceInstall\tServiceInstall\n"
223 "TestService\tTestService\tTestService\t2\t3\t32768\t\t\tTestService\t\t\tservice_comp\t\n"
224 "TestService4\tTestService4\tTestService4\t2\t3\t0\t\t\tTestService4\t\t\tservice_comp3\t\n";
226 static const char service_control_dat
[] =
227 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
228 "s72\tl255\ti2\tL255\tI2\ts72\n"
229 "ServiceControl\tServiceControl\n"
230 "ServiceControl\tTestService3\t8\t\t0\tservice_comp\n"
231 "ServiceControl2\tTestService3\t128\t\t0\tservice_comp2";
233 static const char sss_service_control_dat
[] =
234 "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n"
235 "s72\tl255\ti2\tL255\tI2\ts72\n"
236 "ServiceControl\tServiceControl\n"
237 "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n"
238 "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n"
239 "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n"
240 "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n";
242 static const char sss_install_exec_seq_dat
[] =
243 "Action\tCondition\tSequence\n"
245 "InstallExecuteSequence\tAction\n"
246 "LaunchConditions\t\t100\n"
247 "CostInitialize\t\t800\n"
249 "ResolveSource\t\t950\n"
250 "CostFinalize\t\t1000\n"
251 "InstallValidate\t\t1400\n"
252 "InstallInitialize\t\t1500\n"
253 "StopServices\t\t4000\n"
254 "DeleteServices\t\t5000\n"
255 "MoveFiles\t\t5100\n"
256 "InstallFiles\t\t5200\n"
257 "DuplicateFiles\t\t5300\n"
258 "StartServices\t\t5400\n"
259 "RegisterProduct\t\t5500\n"
260 "PublishFeatures\t\t5600\n"
261 "PublishProduct\t\t5700\n"
262 "InstallFinalize\t\t6000\n";
264 static const char sds_install_exec_seq_dat
[] =
265 "Action\tCondition\tSequence\n"
267 "InstallExecuteSequence\tAction\n"
268 "LaunchConditions\t\t100\n"
269 "CostInitialize\t\t800\n"
271 "ResolveSource\t\t950\n"
272 "CostFinalize\t\t1000\n"
273 "InstallValidate\t\t1400\n"
274 "InstallInitialize\t\t1500\n"
275 "StopServices\t\t5000\n"
276 "DeleteServices\t\t5050\n"
277 "MoveFiles\t\t5100\n"
278 "InstallFiles\t\t5200\n"
279 "DuplicateFiles\t\t5300\n"
280 "InstallServices\t\t5400\n"
281 "StartServices\t\t5450\n"
282 "RegisterProduct\t\t5500\n"
283 "PublishFeatures\t\t5600\n"
284 "PublishProduct\t\t5700\n"
285 "InstallFinalize\t\t6000\n";
287 static const char rof_component_dat
[] =
288 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
289 "s72\tS38\ts72\ti2\tS255\tS72\n"
290 "Component\tComponent\n"
291 "maximus\t\tMSITESTDIR\t0\t1\tmaximus\n";
293 static const char rof_feature_dat
[] =
294 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
295 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
297 "feature\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0\n"
298 "montecristo\t\tFeature\tFeature\t2\t1\tTARGETDIR\t0";
300 static const char rof_feature_comp_dat
[] =
301 "Feature_\tComponent_\n"
303 "FeatureComponents\tFeature_\tComponent_\n"
305 "montecristo\tmaximus";
307 static const char rof_file_dat
[] =
308 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
309 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
311 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1";
313 static const char rof_media_dat
[] =
314 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
315 "i2\ti4\tL64\tS255\tS32\tS72\n"
317 "1\t1\t\t\tDISK1\t\n";
319 static const char ci2_feature_comp_dat
[] =
320 "Feature_\tComponent_\n"
322 "FeatureComponents\tFeature_\tComponent_\n"
325 static const char ci2_file_dat
[] =
326 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
327 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
329 "augustus\taugustus\taugustus\t500\t\t\t8192\t1";
331 static const char pp_install_exec_seq_dat
[] =
332 "Action\tCondition\tSequence\n"
334 "InstallExecuteSequence\tAction\n"
335 "ValidateProductID\t\t700\n"
336 "CostInitialize\t\t800\n"
338 "CostFinalize\t\t1000\n"
339 "InstallValidate\t\t1400\n"
340 "InstallInitialize\t\t1500\n"
341 "ProcessComponents\tPROCESS_COMPONENTS=1 Or FULL=1\t1600\n"
342 "UnpublishFeatures\tUNPUBLISH_FEATURES=1 Or FULL=1\t1800\n"
343 "RemoveFiles\t\t3500\n"
344 "InstallFiles\t\t4000\n"
345 "RegisterUser\tREGISTER_USER=1 Or FULL=1\t6000\n"
346 "RegisterProduct\tREGISTER_PRODUCT=1 Or FULL=1\t6100\n"
347 "PublishFeatures\tPUBLISH_FEATURES=1 Or FULL=1\t6300\n"
348 "PublishProduct\tPUBLISH_PRODUCT=1 Or FULL=1\t6400\n"
349 "InstallFinalize\t\t6600";
351 static const char pp_component_dat
[] =
352 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
353 "s72\tS38\ts72\ti2\tS255\tS72\n"
354 "Component\tComponent\n"
355 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n";
357 static const char ppc_component_dat
[] =
358 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
359 "s72\tS38\ts72\ti2\tS255\tS72\n"
360 "Component\tComponent\n"
361 "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\t\tmaximus\n"
362 "augustus\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\taugustus\n";
364 static const char ppc_file_dat
[] =
365 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
366 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
368 "maximus\tmaximus\tmaximus\t500\t\t\t8192\t1\n"
369 "augustus\taugustus\taugustus\t500\t\t\t8192\t2";
371 static const char ppc_media_dat
[] =
372 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
373 "i2\ti4\tL64\tS255\tS32\tS72\n"
375 "1\t2\t\t\tDISK1\t\n";
377 static const char ppc_feature_comp_dat
[] =
378 "Feature_\tComponent_\n"
380 "FeatureComponents\tFeature_\tComponent_\n"
382 "feature\taugustus\n"
383 "montecristo\tmaximus";
385 static const char cwd_component_dat
[] =
386 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
387 "s72\tS38\ts72\ti2\tS255\tS72\n"
388 "Component\tComponent\n"
389 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
391 static const char rem_component_dat
[] =
392 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
393 "s72\tS38\ts72\ti2\tS255\tS72\n"
394 "Component\tComponent\n"
395 "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t0\t\thydrogen\n"
396 "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t1\t\thelium\n"
397 "lithium\t\tMSITESTDIR\t2\t\tlithium\n";
399 static const char rem_feature_comp_dat
[] =
400 "Feature_\tComponent_\n"
402 "FeatureComponents\tFeature_\tComponent_\n"
403 "feature\thydrogen\n"
407 static const char rem_file_dat
[] =
408 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
409 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
411 "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n"
412 "helium\thelium\thelium\t0\t\t\t8192\t1\n"
413 "lithium\tlithium\tlithium\t0\t\t\t8192\t1";
415 static const char rem_install_exec_seq_dat
[] =
416 "Action\tCondition\tSequence\n"
418 "InstallExecuteSequence\tAction\n"
419 "ValidateProductID\t\t700\n"
420 "CostInitialize\t\t800\n"
422 "CostFinalize\t\t1000\n"
423 "InstallValidate\t\t1400\n"
424 "InstallInitialize\t\t1500\n"
425 "ProcessComponents\t\t1600\n"
426 "UnpublishFeatures\t\t1800\n"
427 "RemoveFiles\t\t3500\n"
428 "InstallFiles\t\t4000\n"
429 "RegisterProduct\t\t6100\n"
430 "PublishFeatures\t\t6300\n"
431 "PublishProduct\t\t6400\n"
432 "InstallFinalize\t\t6600";
434 static const char rem_remove_files_dat
[] =
435 "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n"
436 "s72\ts72\tS255\ts72\tI2\n"
437 "RemoveFile\tFileKey\n"
438 "furlong\thydrogen\tfurlong\tMSITESTDIR\t1\n"
439 "firkin\thelium\tfirkin\tMSITESTDIR\t1\n"
440 "fortnight\tlithium\tfortnight\tMSITESTDIR\t1\n"
441 "becquerel\thydrogen\tbecquerel\tMSITESTDIR\t2\n"
442 "dioptre\thelium\tdioptre\tMSITESTDIR\t2\n"
443 "attoparsec\tlithium\tattoparsec\tMSITESTDIR\t2\n"
444 "storeys\thydrogen\tstoreys\tMSITESTDIR\t3\n"
445 "block\thelium\tblock\tMSITESTDIR\t3\n"
446 "siriometer\tlithium\tsiriometer\tMSITESTDIR\t3\n"
447 "nanoacre\thydrogen\t\tCABOUTDIR\t3\n";
449 static const char mov_move_file_dat
[] =
450 "FileKey\tComponent_\tSourceName\tDestName\tSourceFolder\tDestFolder\tOptions\n"
451 "s72\ts72\tS255\tS255\tS72\ts72\ti2\n"
452 "MoveFile\tFileKey\n"
453 "abkhazia\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t0\n"
454 "bahamas\taugustus\tnonexistent\tdest\tSourceDir\tMSITESTDIR\t1\n"
455 "cambodia\taugustus\tcameroon\tcanada\tSourceDir\tMSITESTDIR\t0\n"
456 "denmark\taugustus\tdjibouti\tdominica\tSourceDir\tMSITESTDIR\t1\n"
457 "ecuador\taugustus\tegypt\telsalvador\tNotAProp\tMSITESTDIR\t1\n"
458 "fiji\taugustus\tfinland\tfrance\tSourceDir\tNotAProp\t1\n"
459 "gabon\taugustus\tgambia\tgeorgia\tSOURCEFULL\tMSITESTDIR\t1\n"
460 "haiti\taugustus\thonduras\thungary\tSourceDir\tDESTFULL\t1\n"
461 "iceland\taugustus\tindia\tindonesia\tMSITESTDIR\tMSITESTDIR\t1\n"
462 "jamaica\taugustus\tjapan\tjordan\tFILEPATHBAD\tMSITESTDIR\t1\n"
463 "kazakhstan\taugustus\t\tkiribati\tFILEPATHGOOD\tMSITESTDIR\t1\n"
464 "laos\taugustus\tlatvia\tlebanon\tSourceDir\tMSITESTDIR\t1\n"
465 "namibia\taugustus\tnauru\tkiribati\tSourceDir\tMSITESTDIR\t1\n"
466 "pakistan\taugustus\tperu\tsfn|poland\tSourceDir\tMSITESTDIR\t1\n"
467 "wildcard\taugustus\tapp*\twildcard\tSourceDir\tMSITESTDIR\t1\n"
468 "single\taugustus\tf?o\tsingle\tSourceDir\tMSITESTDIR\t1\n"
469 "wildcardnodest\taugustus\tbudd*\t\tSourceDir\tMSITESTDIR\t1\n"
470 "singlenodest\taugustus\tb?r\t\tSourceDir\tMSITESTDIR\t1\n";
472 static const char df_directory_dat
[] =
473 "Directory\tDirectory_Parent\tDefaultDir\n"
475 "Directory\tDirectory\n"
476 "THIS\tMSITESTDIR\tthis\n"
477 "DOESNOT\tTHIS\tdoesnot\n"
478 "NONEXISTENT\tDOESNOT\texist\n"
479 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
480 "ProgramFilesFolder\tTARGETDIR\t.\n"
481 "TARGETDIR\t\tSourceDir";
483 static const char df_duplicate_file_dat
[] =
484 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
485 "s72\ts72\ts72\tS255\tS72\n"
486 "DuplicateFile\tFileKey\n"
487 "maximus\tmaximus\tmaximus\taugustus\t\n"
488 "caesar\tmaximus\tmaximus\t\tNONEXISTENT\n"
489 "augustus\tnosuchcomponent\tmaximus\t\tMSITESTDIR\n";
491 static const char wrv_component_dat
[] =
492 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
493 "s72\tS38\ts72\ti2\tS255\tS72\n"
494 "Component\tComponent\n"
495 "augustus\t\tMSITESTDIR\t0\t\taugustus\n";
497 static const char wrv_registry_dat
[] =
498 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
499 "s72\ti2\tl255\tL255\tL0\ts72\n"
500 "Registry\tRegistry\n"
501 "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
502 "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
503 "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
504 "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
505 "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"
506 "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
507 "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
508 "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
509 "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
510 "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
511 "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
512 "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
513 "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
514 "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
515 "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
516 "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n";
518 static const char cf_directory_dat
[] =
519 "Directory\tDirectory_Parent\tDefaultDir\n"
521 "Directory\tDirectory\n"
522 "FIRSTDIR\tMSITESTDIR\tfirst\n"
523 "SECONDDIR\tMSITESTDIR\tsecond\n"
524 "THIRDDIR\tMSITESTDIR\tthird\n"
525 "MSITESTDIR\tProgramFilesFolder\tmsitest\n"
526 "ProgramFilesFolder\tTARGETDIR\t.\n"
527 "TARGETDIR\t\tSourceDir";
529 static const char cf_component_dat
[] =
530 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
531 "s72\tS38\ts72\ti2\tS255\tS72\n"
532 "Component\tComponent\n"
533 "One\t{F8CD42AC-9C38-48FE-8664-B35FD121012A}\tFIRSTDIR\t0\t\tone.txt\n"
534 "Two\t{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}\tSECONDDIR\t0\t\ttwo.txt\n";
536 static const char cf_feature_dat
[] =
537 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
538 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
540 "One\t\tOne\tThe One Feature\t1\t3\tFIRSTDIR\t0\n"
541 "Two\t\tTwo\tThe Two Feature\t1\t3\tSECONDDIR\t0\n";
543 static const char cf_feature_comp_dat
[] =
544 "Feature_\tComponent_\n"
546 "FeatureComponents\tFeature_\tComponent_\n"
550 static const char cf_file_dat
[] =
551 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
552 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
554 "one.txt\tOne\tone.txt\t0\t\t\t0\t1\n"
555 "two.txt\tTwo\ttwo.txt\t0\t\t\t0\t2\n";
557 static const char cf_create_folders_dat
[] =
558 "Directory_\tComponent_\n"
560 "CreateFolder\tDirectory_\tComponent_\n"
565 static const char cf_install_exec_seq_dat
[] =
566 "Action\tCondition\tSequence\n"
568 "InstallExecuteSequence\tAction\n"
569 "CostFinalize\t\t1000\n"
570 "ValidateProductID\t\t700\n"
571 "CostInitialize\t\t800\n"
573 "RemoveFiles\t\t3500\n"
574 "CreateFolders\t\t3700\n"
575 "RemoveFolders\t\t3800\n"
576 "InstallFiles\t\t4000\n"
577 "RegisterUser\t\t6000\n"
578 "RegisterProduct\t\t6100\n"
579 "PublishFeatures\t\t6300\n"
580 "PublishProduct\t\t6400\n"
581 "InstallFinalize\t\t6600\n"
582 "InstallInitialize\t\t1500\n"
583 "ProcessComponents\t\t1600\n"
584 "UnpublishFeatures\t\t1800\n"
585 "InstallValidate\t\t1400\n"
586 "LaunchConditions\t\t100\n";
588 static const char sr_selfreg_dat
[] =
594 static const char sr_install_exec_seq_dat
[] =
595 "Action\tCondition\tSequence\n"
597 "InstallExecuteSequence\tAction\n"
598 "CostFinalize\t\t1000\n"
599 "CostInitialize\t\t800\n"
601 "ResolveSource\t\t950\n"
602 "MoveFiles\t\t1700\n"
603 "SelfUnregModules\t\t3900\n"
604 "InstallFiles\t\t4000\n"
605 "DuplicateFiles\t\t4500\n"
606 "WriteEnvironmentStrings\t\t4550\n"
607 "CreateShortcuts\t\t4600\n"
608 "InstallFinalize\t\t6600\n"
609 "InstallInitialize\t\t1500\n"
610 "InstallValidate\t\t1400\n"
611 "LaunchConditions\t\t100\n";
613 static const char font_media_dat
[] =
614 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
615 "i2\ti4\tL64\tS255\tS32\tS72\n"
617 "1\t3\t\t\tDISK1\t\n";
619 static const char font_file_dat
[] =
620 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
621 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
623 "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n";
625 static const char font_feature_dat
[] =
626 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
627 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
629 "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n";
631 static const char font_component_dat
[] =
632 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
633 "s72\tS38\ts72\ti2\tS255\tS72\n"
634 "Component\tComponent\n"
635 "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n";
637 static const char font_feature_comp_dat
[] =
638 "Feature_\tComponent_\n"
640 "FeatureComponents\tFeature_\tComponent_\n"
643 static const char font_dat
[] =
647 "font.ttf\tmsi test font\n";
649 static const char font_install_exec_seq_dat
[] =
650 "Action\tCondition\tSequence\n"
652 "InstallExecuteSequence\tAction\n"
653 "ValidateProductID\t\t700\n"
654 "CostInitialize\t\t800\n"
656 "CostFinalize\t\t1000\n"
657 "InstallValidate\t\t1400\n"
658 "InstallInitialize\t\t1500\n"
659 "ProcessComponents\t\t1600\n"
660 "UnpublishFeatures\t\t1800\n"
661 "RemoveFiles\t\t3500\n"
662 "InstallFiles\t\t4000\n"
663 "RegisterFonts\t\t4100\n"
664 "UnregisterFonts\t\t4200\n"
665 "RegisterUser\t\t6000\n"
666 "RegisterProduct\t\t6100\n"
667 "PublishFeatures\t\t6300\n"
668 "PublishProduct\t\t6400\n"
669 "InstallFinalize\t\t6600";
671 static const char vp_property_dat
[] =
674 "Property\tProperty\n"
677 "InstallMode\tTypical\n"
678 "Manufacturer\tWine\n"
679 "PIDTemplate\t###-#######\n"
680 "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n"
681 "ProductLanguage\t1033\n"
682 "ProductName\tMSITEST\n"
683 "ProductVersion\t1.1.1\n"
684 "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"
685 "MSIFASTINSTALL\t1\n";
687 static const char vp_custom_action_dat
[] =
688 "Action\tType\tSource\tTarget\tISComments\n"
689 "s72\ti2\tS64\tS0\tS255\n"
690 "CustomAction\tAction\n"
691 "SetProductID1\t51\tProductID\t1\t\n"
692 "SetProductID2\t51\tProductID\t2\t\n"
693 "TestProductID1\t19\t\t\tHalts installation\n"
694 "TestProductID2\t19\t\t\tHalts installation\n";
696 static const char vp_install_exec_seq_dat
[] =
697 "Action\tCondition\tSequence\n"
699 "InstallExecuteSequence\tAction\n"
700 "LaunchConditions\t\t100\n"
701 "CostInitialize\t\t800\n"
703 "CostFinalize\t\t1000\n"
704 "InstallValidate\t\t1400\n"
705 "InstallInitialize\t\t1500\n"
706 "SetProductID1\tSET_PRODUCT_ID=1\t3000\n"
707 "SetProductID2\tSET_PRODUCT_ID=2\t3100\n"
708 "ValidateProductID\t\t3200\n"
709 "InstallExecute\t\t3300\n"
710 "TestProductID1\tProductID=1\t3400\n"
711 "TestProductID2\tProductID=\"123-1234567\"\t3500\n"
712 "InstallFiles\t\t4000\n"
713 "InstallFinalize\t\t6000\n";
715 static const char odbc_file_dat
[] =
716 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
717 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
719 "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n"
720 "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n"
721 "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n"
722 "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n"
723 "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n";
725 static const char odbc_feature_dat
[] =
726 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
727 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
729 "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n";
731 static const char odbc_feature_comp_dat
[] =
732 "Feature_\tComponent_\n"
734 "FeatureComponents\tFeature_\tComponent_\n"
737 static const char odbc_component_dat
[] =
738 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
739 "s72\tS38\ts72\ti2\tS255\tS72\n"
740 "Component\tComponent\n"
741 "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
743 static const char odbc_driver_dat
[] =
744 "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
745 "s72\ts72\ts255\ts72\tS72\n"
746 "ODBCDriver\tDriver\n"
747 "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
748 "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
750 static const char odbc_translator_dat
[] =
751 "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n"
752 "s72\ts72\ts255\ts72\tS72\n"
753 "ODBCTranslator\tTranslator\n"
754 "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n"
755 "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n";
757 static const char odbc_datasource_dat
[] =
758 "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n"
759 "s72\ts72\ts255\ts255\ti2\n"
760 "ODBCDataSource\tDataSource\n"
761 "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n";
763 static const char odbc_install_exec_seq_dat
[] =
764 "Action\tCondition\tSequence\n"
766 "InstallExecuteSequence\tAction\n"
767 "LaunchConditions\t\t100\n"
768 "CostInitialize\t\t800\n"
770 "CostFinalize\t\t1000\n"
771 "InstallValidate\t\t1400\n"
772 "InstallInitialize\t\t1500\n"
773 "ProcessComponents\t\t1600\n"
774 "InstallODBC\t\t3000\n"
775 "RemoveODBC\t\t3100\n"
776 "RemoveFiles\t\t3900\n"
777 "InstallFiles\t\t4000\n"
778 "RegisterProduct\t\t5000\n"
779 "PublishFeatures\t\t5100\n"
780 "PublishProduct\t\t5200\n"
781 "InstallFinalize\t\t6000\n";
783 static const char odbc_media_dat
[] =
784 "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n"
785 "i2\ti4\tL64\tS255\tS32\tS72\n"
787 "1\t5\t\t\tDISK1\t\n";
789 static const char tl_file_dat
[] =
790 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
791 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
793 "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n";
795 static const char tl_feature_dat
[] =
796 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
797 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
799 "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n";
801 static const char tl_feature_comp_dat
[] =
802 "Feature_\tComponent_\n"
804 "FeatureComponents\tFeature_\tComponent_\n"
805 "typelib\ttypelib\n";
807 static const char tl_component_dat
[] =
808 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
809 "s72\tS38\ts72\ti2\tS255\tS72\n"
810 "Component\tComponent\n"
811 "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n";
813 static const char tl_typelib_dat
[] =
814 "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n"
815 "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n"
816 "TypeLib\tLibID\tLanguage\tComponent_\n"
817 "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n";
819 static const char tl_install_exec_seq_dat
[] =
820 "Action\tCondition\tSequence\n"
822 "InstallExecuteSequence\tAction\n"
823 "LaunchConditions\t\t100\n"
824 "CostInitialize\t\t800\n"
826 "CostFinalize\t\t1000\n"
827 "InstallValidate\t\t1400\n"
828 "InstallInitialize\t\t1500\n"
829 "ProcessComponents\t\t1600\n"
830 "RemoveFiles\t\t1700\n"
831 "InstallFiles\t\t2000\n"
832 "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n"
833 "UnregisterTypeLibraries\t\t3100\n"
834 "RegisterProduct\t\t5100\n"
835 "PublishFeatures\t\t5200\n"
836 "PublishProduct\t\t5300\n"
837 "InstallFinalize\t\t6000\n";
839 static const char crs_file_dat
[] =
840 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
841 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
843 "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n";
845 static const char crs_feature_dat
[] =
846 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
847 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
849 "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n";
851 static const char crs_feature_comp_dat
[] =
852 "Feature_\tComponent_\n"
854 "FeatureComponents\tFeature_\tComponent_\n"
855 "shortcut\tshortcut\n";
857 static const char crs_component_dat
[] =
858 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
859 "s72\tS38\ts72\ti2\tS255\tS72\n"
860 "Component\tComponent\n"
861 "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n";
863 static const char crs_shortcut_dat
[] =
864 "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n"
865 "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n"
866 "Shortcut\tShortcut\n"
867 "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n";
869 static const char crs_install_exec_seq_dat
[] =
870 "Action\tCondition\tSequence\n"
872 "InstallExecuteSequence\tAction\n"
873 "LaunchConditions\t\t100\n"
874 "CostInitialize\t\t800\n"
876 "CostFinalize\t\t1000\n"
877 "InstallValidate\t\t1400\n"
878 "InstallInitialize\t\t1500\n"
879 "ProcessComponents\t\t1600\n"
880 "RemoveFiles\t\t1700\n"
881 "InstallFiles\t\t2000\n"
882 "RemoveShortcuts\t\t3000\n"
883 "CreateShortcuts\t\t3100\n"
884 "RegisterProduct\t\t5000\n"
885 "PublishFeatures\t\t5100\n"
886 "PublishProduct\t\t5200\n"
887 "InstallFinalize\t\t6000\n";
889 static const char pub_file_dat
[] =
890 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
891 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
893 "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n";
895 static const char pub_feature_dat
[] =
896 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
897 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
899 "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n";
901 static const char pub_feature_comp_dat
[] =
902 "Feature_\tComponent_\n"
904 "FeatureComponents\tFeature_\tComponent_\n"
905 "publish\tpublish\n";
907 static const char pub_component_dat
[] =
908 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
909 "s72\tS38\ts72\ti2\tS255\tS72\n"
910 "Component\tComponent\n"
911 "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n";
913 static const char pub_publish_component_dat
[] =
914 "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n"
915 "s38\ts255\ts72\tL255\ts38\n"
916 "PublishComponent\tComponentId\tQualifier\tComponent_\n"
917 "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n";
919 static const char pub_install_exec_seq_dat
[] =
920 "Action\tCondition\tSequence\n"
922 "InstallExecuteSequence\tAction\n"
923 "LaunchConditions\t\t100\n"
924 "CostInitialize\t\t800\n"
926 "CostFinalize\t\t1000\n"
927 "InstallValidate\t\t1400\n"
928 "InstallInitialize\t\t1500\n"
929 "ProcessComponents\t\t1600\n"
930 "RemoveFiles\t\t1700\n"
931 "InstallFiles\t\t2000\n"
932 "PublishComponents\t\t3000\n"
933 "UnpublishComponents\t\t3100\n"
934 "RegisterProduct\t\t5000\n"
935 "PublishFeatures\t\t5100\n"
936 "PublishProduct\t\t5200\n"
937 "InstallFinalize\t\t6000\n";
939 static const char rd_file_dat
[] =
940 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
941 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
943 "original.txt\tduplicate\toriginal.txt\t1000\t\t\t8192\t1\n"
944 "original2.txt\tduplicate\toriginal2.txt\t1000\t\t\t8192\t2\n"
945 "original3.txt\tduplicate2\toriginal3.txt\t1000\t\t\t8192\t3\n";
947 static const char rd_feature_dat
[] =
948 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
949 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
951 "duplicate\t\t\tduplicate feature\t1\t2\tMSITESTDIR\t0\n";
953 static const char rd_feature_comp_dat
[] =
954 "Feature_\tComponent_\n"
956 "FeatureComponents\tFeature_\tComponent_\n"
957 "duplicate\tduplicate\n";
959 static const char rd_component_dat
[] =
960 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
961 "s72\tS38\ts72\ti2\tS255\tS72\n"
962 "Component\tComponent\n"
963 "duplicate\t{EB45D06A-ADFE-44E3-8D41-B7DE150E41AD}\tMSITESTDIR\t0\t\toriginal.txt\n"
964 "duplicate2\t{B8BA60E0-B2E9-488E-9D0E-E60F25F04F97}\tMSITESTDIR\t0\tDUPLICATE2=1\toriginal3.txt\n";
966 static const char rd_duplicate_file_dat
[] =
967 "FileKey\tComponent_\tFile_\tDestName\tDestFolder\n"
968 "s72\ts72\ts72\tS255\tS72\n"
969 "DuplicateFile\tFileKey\n"
970 "duplicate\tduplicate\toriginal.txt\tduplicate.txt\t\n"
971 "duplicate2\tduplicate\toriginal2.txt\t\tMSITESTDIR\n"
972 "duplicate3\tduplicate2\toriginal3.txt\tduplicate2.txt\t\n";
974 static const char rd_install_exec_seq_dat
[] =
975 "Action\tCondition\tSequence\n"
977 "InstallExecuteSequence\tAction\n"
978 "LaunchConditions\t\t100\n"
979 "CostInitialize\t\t800\n"
981 "CostFinalize\t\t1000\n"
982 "InstallValidate\t\t1400\n"
983 "InstallInitialize\t\t1500\n"
984 "ProcessComponents\t\t1600\n"
985 "RemoveDuplicateFiles\t\t1900\n"
986 "InstallFiles\t\t2000\n"
987 "DuplicateFiles\t\t2100\n"
988 "RegisterProduct\t\t5000\n"
989 "PublishFeatures\t\t5100\n"
990 "PublishProduct\t\t5200\n"
991 "InstallFinalize\t\t6000\n";
993 static const char rrv_file_dat
[] =
994 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
995 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
997 "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
999 static const char rrv_feature_dat
[] =
1000 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1001 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1002 "Feature\tFeature\n"
1003 "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
1005 static const char rrv_feature_comp_dat
[] =
1006 "Feature_\tComponent_\n"
1008 "FeatureComponents\tFeature_\tComponent_\n"
1009 "registry\tregistry\n";
1011 static const char rrv_component_dat
[] =
1012 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1013 "s72\tS38\ts72\ti2\tS255\tS72\n"
1014 "Component\tComponent\n"
1015 "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
1017 static const char rrv_registry_dat
[] =
1018 "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
1019 "s72\ti2\tl255\tL255\tL0\ts72\n"
1020 "Registry\tRegistry\n"
1021 "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
1022 "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
1023 "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
1025 static const char rrv_remove_registry_dat
[] =
1026 "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
1027 "s72\ti2\tl255\tL255\ts72\n"
1028 "RemoveRegistry\tRemoveRegistry\n"
1029 "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
1030 "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
1031 "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
1033 static const char rrv_install_exec_seq_dat
[] =
1034 "Action\tCondition\tSequence\n"
1036 "InstallExecuteSequence\tAction\n"
1037 "LaunchConditions\t\t100\n"
1038 "CostInitialize\t\t800\n"
1040 "CostFinalize\t\t1000\n"
1041 "InstallValidate\t\t1400\n"
1042 "InstallInitialize\t\t1500\n"
1043 "ProcessComponents\t\t1600\n"
1044 "RemoveFiles\t\t1700\n"
1045 "InstallFiles\t\t2000\n"
1046 "RemoveRegistryValues\t\t3000\n"
1047 "RegisterProduct\t\t5000\n"
1048 "PublishFeatures\t\t5100\n"
1049 "PublishProduct\t\t5200\n"
1050 "InstallFinalize\t\t6000\n";
1052 static const char frp_file_dat
[] =
1053 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1054 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1056 "product.txt\tproduct\tproduct.txt\t1000\t\t\t8192\t1\n";
1058 static const char frp_feature_dat
[] =
1059 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1060 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1061 "Feature\tFeature\n"
1062 "product\t\t\tproduct feature\t1\t2\tMSITESTDIR\t0\n";
1064 static const char frp_feature_comp_dat
[] =
1065 "Feature_\tComponent_\n"
1067 "FeatureComponents\tFeature_\tComponent_\n"
1068 "product\tproduct\n";
1070 static const char frp_component_dat
[] =
1071 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1072 "s72\tS38\ts72\ti2\tS255\tS72\n"
1073 "Component\tComponent\n"
1074 "product\t{44725EE0-EEA8-40BD-8162-A48224A2FEA1}\tMSITESTDIR\t0\t\tproduct.txt\n";
1076 static const char frp_custom_action_dat
[] =
1077 "Action\tType\tSource\tTarget\tISComments\n"
1078 "s72\ti2\tS64\tS0\tS255\n"
1079 "CustomAction\tAction\n"
1080 "TestProp\t19\t\t\tPROP set\n";
1082 static const char frp_upgrade_dat
[] =
1083 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1084 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1085 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1086 "{4C0EAA15-0264-4E5A-8758-609EF142B92D}\t1.1.1\t2.2.2\t\t768\t\tPROP\n";
1088 static const char frp_install_exec_seq_dat
[] =
1089 "Action\tCondition\tSequence\n"
1091 "InstallExecuteSequence\tAction\n"
1092 "FindRelatedProducts\t\t50\n"
1093 "TestProp\tPROP AND NOT REMOVE\t51\n"
1094 "LaunchConditions\t\t100\n"
1095 "CostInitialize\t\t800\n"
1097 "CostFinalize\t\t1000\n"
1098 "InstallValidate\t\t1400\n"
1099 "InstallInitialize\t\t1500\n"
1100 "ProcessComponents\t\t1600\n"
1101 "RemoveFiles\t\t1700\n"
1102 "InstallFiles\t\t2000\n"
1103 "RegisterProduct\t\t5000\n"
1104 "PublishFeatures\t\t5100\n"
1105 "PublishProduct\t\t5200\n"
1106 "InstallFinalize\t\t6000\n";
1108 static const char riv_file_dat
[] =
1109 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1110 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1112 "inifile.txt\tinifile\tinifile.txt\t1000\t\t\t8192\t1\n";
1114 static const char riv_feature_dat
[] =
1115 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1116 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1117 "Feature\tFeature\n"
1118 "inifile\t\t\tinifile feature\t1\t2\tMSITESTDIR\t0\n";
1120 static const char riv_feature_comp_dat
[] =
1121 "Feature_\tComponent_\n"
1123 "FeatureComponents\tFeature_\tComponent_\n"
1124 "inifile\tinifile\n";
1126 static const char riv_component_dat
[] =
1127 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1128 "s72\tS38\ts72\ti2\tS255\tS72\n"
1129 "Component\tComponent\n"
1130 "inifile\t{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}\tMSITESTDIR\t0\t\tinifile.txt\n";
1132 static const char riv_ini_file_dat
[] =
1133 "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1134 "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n"
1135 "IniFile\tIniFile\n"
1136 "inifile1\ttest.ini\tMSITESTDIR\tsection1\tkey1\tvalue1\t0\tinifile\n";
1138 static const char riv_remove_ini_file_dat
[] =
1139 "RemoveIniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n"
1140 "s72\tl255\tS72\tl96\tl128\tL255\ti2\ts72\n"
1141 "RemoveIniFile\tRemoveIniFile\n"
1142 "inifile1\ttest.ini\tMSITESTDIR\tsectionA\tkeyA\tvalueA\t2\tinifile\n";
1144 static const char riv_install_exec_seq_dat
[] =
1145 "Action\tCondition\tSequence\n"
1147 "InstallExecuteSequence\tAction\n"
1148 "LaunchConditions\t\t100\n"
1149 "CostInitialize\t\t800\n"
1151 "CostFinalize\t\t1000\n"
1152 "InstallValidate\t\t1400\n"
1153 "InstallInitialize\t\t1500\n"
1154 "ProcessComponents\t\t1600\n"
1155 "RemoveFiles\t\t1700\n"
1156 "InstallFiles\t\t2000\n"
1157 "RemoveIniValues\t\t3000\n"
1158 "RegisterProduct\t\t5000\n"
1159 "PublishFeatures\t\t5100\n"
1160 "PublishProduct\t\t5200\n"
1161 "InstallFinalize\t\t6000\n";
1163 static const char res_file_dat
[] =
1164 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1165 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1167 "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n";
1169 static const char res_feature_dat
[] =
1170 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1171 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1172 "Feature\tFeature\n"
1173 "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n";
1175 static const char res_feature_comp_dat
[] =
1176 "Feature_\tComponent_\n"
1178 "FeatureComponents\tFeature_\tComponent_\n"
1181 static const char res_component_dat
[] =
1182 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1183 "s72\tS38\ts72\ti2\tS255\tS72\n"
1184 "Component\tComponent\n"
1185 "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n";
1187 static const char res_environment_dat
[] =
1188 "Environment\tName\tValue\tComponent_\n"
1189 "s72\tl255\tL255\ts72\n"
1190 "Environment\tEnvironment\n"
1191 "var1\t=-MSITESTVAR1\t1\tenvvar\n"
1192 "var2\t=+-MSITESTVAR2\t1\tenvvar\n"
1193 "var3\t=MSITESTVAR3\t1\tenvvar\n"
1194 "var4\t=-MSITESTVAR4\t\tenvvar\n"
1195 "var5\t=MSITESTVAR5\t\tenvvar\n"
1196 "Var6\t-MSITESTVAR6\t1;[~]\tenvvar\n"
1197 "Var7\t-MSITESTVAR7\t[~];1\tenvvar\n"
1198 "Var8\t-MSITESTVAR8\t1;[~]\tenvvar\n"
1199 "Var9\t-MSITESTVAR9\t[~];1\tenvvar\n"
1200 "Var10\t-MSITESTVAR10\t1\tenvvar\n"
1201 "Var11\t-MSITESTVAR11\t2\tenvvar\n";
1203 static const char res_install_exec_seq_dat
[] =
1204 "Action\tCondition\tSequence\n"
1206 "InstallExecuteSequence\tAction\n"
1207 "LaunchConditions\t\t100\n"
1208 "CostInitialize\t\t800\n"
1210 "CostFinalize\t\t1000\n"
1211 "InstallValidate\t\t1400\n"
1212 "InstallInitialize\t\t1500\n"
1213 "ProcessComponents\t\t1600\n"
1214 "RemoveFiles\t\t1700\n"
1215 "InstallFiles\t\t2000\n"
1216 "RemoveEnvironmentStrings\t\t3000\n"
1217 "RegisterProduct\t\t5000\n"
1218 "PublishFeatures\t\t5100\n"
1219 "PublishProduct\t\t5200\n"
1220 "InstallFinalize\t\t6000\n";
1222 static const char rci_file_dat
[] =
1223 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1224 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1226 "class.txt\tclass\tclass.txt\t1000\t\t\t8192\t1\n";
1228 static const char rci_feature_dat
[] =
1229 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1230 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1231 "Feature\tFeature\n"
1232 "class\t\t\tclass feature\t1\t2\tMSITESTDIR\t0\n";
1234 static const char rci_feature_comp_dat
[] =
1235 "Feature_\tComponent_\n"
1237 "FeatureComponents\tFeature_\tComponent_\n"
1240 static const char rci_component_dat
[] =
1241 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1242 "s72\tS38\ts72\ti2\tS255\tS72\n"
1243 "Component\tComponent\n"
1244 "class\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tclass.txt\n";
1246 static const char rci_appid_dat
[] =
1247 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1248 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1250 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1252 static const char rci_class_dat
[] =
1253 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1254 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1255 "Class\tCLSID\tContext\tComponent_\n"
1256 "{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tLocalServer\tclass\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tclass\t\n";
1258 static const char rci_install_exec_seq_dat
[] =
1259 "Action\tCondition\tSequence\n"
1261 "InstallExecuteSequence\tAction\n"
1262 "LaunchConditions\t\t100\n"
1263 "CostInitialize\t\t800\n"
1265 "CostFinalize\t\t1000\n"
1266 "InstallValidate\t\t1400\n"
1267 "InstallInitialize\t\t1500\n"
1268 "ProcessComponents\t\t1600\n"
1269 "RemoveFiles\t\t1700\n"
1270 "InstallFiles\t\t2000\n"
1271 "UnregisterClassInfo\t\t3000\n"
1272 "RegisterClassInfo\t\t4000\n"
1273 "RegisterProduct\t\t5000\n"
1274 "PublishFeatures\t\t5100\n"
1275 "PublishProduct\t\t5200\n"
1276 "InstallFinalize\t\t6000\n";
1278 static const char rei_file_dat
[] =
1279 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1280 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1282 "extension.txt\textension\textension.txt\t1000\t\t\t8192\t1\n";
1284 static const char rei_feature_dat
[] =
1285 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1286 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1287 "Feature\tFeature\n"
1288 "extension\t\t\textension feature\t1\t2\tMSITESTDIR\t0\n";
1290 static const char rei_feature_comp_dat
[] =
1291 "Feature_\tComponent_\n"
1293 "FeatureComponents\tFeature_\tComponent_\n"
1294 "extension\textension\n";
1296 static const char rei_component_dat
[] =
1297 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1298 "s72\tS38\ts72\ti2\tS255\tS72\n"
1299 "Component\tComponent\n"
1300 "extension\t{9A3060D4-60BA-4A82-AB55-9FB148AD013C}\tMSITESTDIR\t0\t\textension.txt\n";
1302 static const char rei_extension_dat
[] =
1303 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1304 "s255\ts72\tS255\tS64\ts38\n"
1305 "Extension\tExtension\tComponent_\n"
1306 "extension\textension\tProg.Id.1\t\textension\n";
1308 static const char rei_verb_dat
[] =
1309 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1310 "s255\ts32\tI2\tL255\tL255\n"
1311 "Verb\tExtension_\tVerb\n"
1312 "extension\tOpen\t1\t&Open\t/argument\n";
1314 static const char rei_progid_dat
[] =
1315 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1316 "s255\tS255\tS38\tL255\tS72\tI2\n"
1318 "Prog.Id.1\t\t\tdescription\t\t\n";
1320 static const char rei_install_exec_seq_dat
[] =
1321 "Action\tCondition\tSequence\n"
1323 "InstallExecuteSequence\tAction\n"
1324 "LaunchConditions\t\t100\n"
1325 "CostInitialize\t\t800\n"
1327 "CostFinalize\t\t1000\n"
1328 "InstallValidate\t\t1400\n"
1329 "InstallInitialize\t\t1500\n"
1330 "ProcessComponents\t\t1600\n"
1331 "RemoveFiles\t\t1700\n"
1332 "InstallFiles\t\t2000\n"
1333 "UnregisterExtensionInfo\t\t3000\n"
1334 "RegisterExtensionInfo\t\t4000\n"
1335 "RegisterProduct\t\t5000\n"
1336 "PublishFeatures\t\t5100\n"
1337 "PublishProduct\t\t5200\n"
1338 "InstallFinalize\t\t6000\n";
1340 static const char rpi_file_dat
[] =
1341 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1342 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1344 "progid.txt\tprogid\tprogid.txt\t1000\t\t\t8192\t1\n";
1346 static const char rpi_feature_dat
[] =
1347 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1348 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1349 "Feature\tFeature\n"
1350 "progid\t\t\tprogid feature\t1\t2\tMSITESTDIR\t0\n";
1352 static const char rpi_feature_comp_dat
[] =
1353 "Feature_\tComponent_\n"
1355 "FeatureComponents\tFeature_\tComponent_\n"
1358 static const char rpi_component_dat
[] =
1359 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1360 "s72\tS38\ts72\ti2\tS255\tS72\n"
1361 "Component\tComponent\n"
1362 "progid\t{89A98345-F8A1-422E-A48B-0250B5809F2D}\tMSITESTDIR\t0\t\tprogid.txt\n";
1364 static const char rpi_appid_dat
[] =
1365 "AppId\tRemoteServerName\tLocalService\tServiceParameters\tDllSurrogate\tActivateAtStorage\tRunAsInteractiveUser\n"
1366 "s38\tS255\tS255\tS255\tS255\tI2\tI2\n"
1368 "{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\t\t\t\t\t\t\n";
1370 static const char rpi_class_dat
[] =
1371 "CLSID\tContext\tComponent_\tProgId_Default\tDescription\tAppId_\tFileTypeMask\tIcon_\tIconIndex\tDefInprocHandler\tArgument\tFeature_\tAttributes\n"
1372 "s38\ts32\ts72\tS255\tL255\tS38\tS255\tS72\tI2\tS32\tS255\ts38\tI2\n"
1373 "Class\tCLSID\tContext\tComponent_\n"
1374 "{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"
1375 "{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"
1376 "{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tLocalServer\tprogid\t\tdescription\t{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}\tmask1;mask2\t\t\t2\t\tprogid\t\n";
1378 static const char rpi_extension_dat
[] =
1379 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1380 "s255\ts72\tS255\tS64\ts38\n"
1381 "Extension\tExtension\tComponent_\n"
1382 "winetest\tprogid\tWinetest.Extension\t\tprogid\n";
1384 static const char rpi_verb_dat
[] =
1385 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1386 "s255\ts32\tI2\tL255\tL255\n"
1387 "Verb\tExtension_\tVerb\n"
1388 "winetest\tOpen\t1\t&Open\t/argument\n";
1390 static const char rpi_progid_dat
[] =
1391 "ProgId\tProgId_Parent\tClass_\tDescription\tIcon_\tIconIndex\n"
1392 "s255\tS255\tS38\tL255\tS72\tI2\n"
1394 "Winetest.Class.1\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1395 "Winetest.Class\tWinetest.Class.1\t\tdescription\t\t\n"
1396 "Winetest.Class.2\t\t{110913E7-86D1-4BF3-9922-BA103FCDDDFA}\tdescription\t\t\n"
1397 "Winetest.VerClass.1\t\t{904E6BC9-F57F-4412-B460-D40DE2F256E2}\tdescription\t\t\n"
1398 "Winetest.VerClass\tWinetest.VerClass.1\t\tdescription\t\t\n"
1399 "Winetest.NoProgIdClass.1\t\t{57C413FB-CA02-498A-81F6-7E769BDB7C97}\tdescription\t\t\n"
1400 "Winetest.NoProgIdClass\tWinetest.NoProgIdClass.1\t\tdescription\t\t\n"
1401 "Winetest.Orphaned\t\t\tdescription\t\t\n"
1402 "Winetest.Orphaned2\t\t\tdescription\t\t\n"
1403 "Winetest.Extension\t\t\tdescription\t\t\n";
1405 static const char rpi_install_exec_seq_dat
[] =
1406 "Action\tCondition\tSequence\n"
1408 "InstallExecuteSequence\tAction\n"
1409 "LaunchConditions\t\t100\n"
1410 "CostInitialize\t\t800\n"
1412 "CostFinalize\t\t1000\n"
1413 "InstallValidate\t\t1400\n"
1414 "InstallInitialize\t\t1500\n"
1415 "ProcessComponents\t\t1600\n"
1416 "RemoveFiles\t\t1700\n"
1417 "UnregisterClassInfo\t\t3000\n"
1418 "UnregisterExtensionInfo\t\t3200\n"
1419 "UnregisterProgIdInfo\t\t3400\n"
1420 "InstallFiles\t\t3600\n"
1421 "RegisterClassInfo\t\t4000\n"
1422 "RegisterExtensionInfo\t\t4200\n"
1423 "RegisterProgIdInfo\t\t4400\n"
1424 "RegisterProduct\t\t5000\n"
1425 "PublishFeatures\t\t5100\n"
1426 "PublishProduct\t\t5200\n"
1427 "InstallFinalize\t\t6000\n";
1429 static const char rmi_file_dat
[] =
1430 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1431 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1433 "mime.txt\tmime\tmime.txt\t1000\t\t\t8192\t1\n";
1435 static const char rmi_feature_dat
[] =
1436 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1437 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1438 "Feature\tFeature\n"
1439 "mime\t\t\tmime feature\t1\t2\tMSITESTDIR\t0\n";
1441 static const char rmi_feature_comp_dat
[] =
1442 "Feature_\tComponent_\n"
1444 "FeatureComponents\tFeature_\tComponent_\n"
1447 static const char rmi_component_dat
[] =
1448 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1449 "s72\tS38\ts72\ti2\tS255\tS72\n"
1450 "Component\tComponent\n"
1451 "mime\t{A1D630CE-13A7-4882-AFDD-148E2BBAFC6D}\tMSITESTDIR\t0\t\tmime.txt\n";
1453 static const char rmi_extension_dat
[] =
1454 "Extension\tComponent_\tProgId_\tMIME_\tFeature_\n"
1455 "s255\ts72\tS255\tS64\ts38\n"
1456 "Extension\tExtension\tComponent_\n"
1457 "mime\tmime\t\tmime/type\tmime\n";
1459 static const char rmi_verb_dat
[] =
1460 "Extension_\tVerb\tSequence\tCommand\tArgument\n"
1461 "s255\ts32\tI2\tL255\tL255\n"
1462 "Verb\tExtension_\tVerb\n"
1463 "mime\tOpen\t1\t&Open\t/argument\n";
1465 static const char rmi_mime_dat
[] =
1466 "ContentType\tExtension_\tCLSID\n"
1468 "MIME\tContentType\n"
1469 "mime/type\tmime\t\n";
1471 static const char rmi_install_exec_seq_dat
[] =
1472 "Action\tCondition\tSequence\n"
1474 "InstallExecuteSequence\tAction\n"
1475 "LaunchConditions\t\t100\n"
1476 "CostInitialize\t\t800\n"
1478 "CostFinalize\t\t1000\n"
1479 "InstallValidate\t\t1400\n"
1480 "InstallInitialize\t\t1500\n"
1481 "ProcessComponents\t\t1600\n"
1482 "RemoveFiles\t\t1700\n"
1483 "InstallFiles\t\t2000\n"
1484 "UnregisterExtensionInfo\t\t3000\n"
1485 "UnregisterMIMEInfo\t\t3500\n"
1486 "RegisterExtensionInfo\t\t4000\n"
1487 "RegisterMIMEInfo\t\t4500\n"
1488 "RegisterProduct\t\t5000\n"
1489 "PublishFeatures\t\t5100\n"
1490 "PublishProduct\t\t5200\n"
1491 "InstallFinalize\t\t6000\n";
1493 static const char pa_file_dat
[] =
1494 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1495 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1497 "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n"
1498 "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n"
1499 "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n"
1500 "manifest_local.txt\twin32_local\tmanifest_local.txt\t1000\t\t\t8192\t1\n"
1501 "dotnet.txt\tdotnet\tdotnet.txt\t1000\t\t\t8192\t1\n"
1502 "dotnet_local.txt\tdotnet_local\tdotnet_local.txt\t1000\t\t\t8192\t1\n"
1503 "application_win32.txt\twin32_local\tapplication_win32.txt\t1000\t\t\t8192\t1\n"
1504 "application_dotnet.txt\tdotnet_local\tapplication_dotnet.txt\t1000\t\t\t8192\t1\n";
1506 static const char pa_feature_dat
[] =
1507 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1508 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1509 "Feature\tFeature\n"
1510 "assembly\t\t\tassembly feature\t1\t2\tMSITESTDIR\t0\n";
1512 static const char pa_feature_comp_dat
[] =
1513 "Feature_\tComponent_\n"
1515 "FeatureComponents\tFeature_\tComponent_\n"
1517 "assembly\twin32_local\n"
1518 "assembly\tdotnet\n"
1519 "assembly\tdotnet_local\n";
1521 static const char pa_component_dat
[] =
1522 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1523 "s72\tS38\ts72\ti2\tS255\tS72\n"
1524 "Component\tComponent\n"
1525 "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n"
1526 "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n"
1527 "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n"
1528 "dotnet_local\t{4E8567E8-8EAE-4E36-90F1-B99D33C663F8}\tMSITESTDIR\t0\t\tdotnet_local.txt\n";
1530 static const char pa_msi_assembly_dat
[] =
1531 "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n"
1532 "s72\ts38\tS72\tS72\tI2\n"
1533 "MsiAssembly\tComponent_\n"
1534 "win32\tassembly\tmanifest.txt\t\t1\n"
1535 "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n"
1536 "dotnet\tassembly\t\t\t0\n"
1537 "dotnet_local\tassembly\t\tapplication_dotnet.txt\t0\n";
1539 static const char pa_msi_assembly_name_dat
[] =
1540 "Component_\tName\tValue\n"
1542 "MsiAssemblyName\tComponent_\tName\n"
1543 "win32\tName\tWine.Win32.Assembly\n"
1544 "win32\tprocessorArchitecture\tx86\n"
1545 "win32\tpublicKeyToken\tabcdef0123456789\n"
1546 "win32\ttype\twin32\n"
1547 "win32\tversion\t1.0.0.0\n"
1548 "win32_local\tName\tWine.Win32.Local.Assembly\n"
1549 "win32_local\tprocessorArchitecture\tx86\n"
1550 "win32_local\tpublicKeyToken\tabcdef0123456789\n"
1551 "win32_local\ttype\twin32\n"
1552 "win32_local\tversion\t1.0.0.0\n"
1553 "dotnet\tName\tWine.Dotnet.Assembly\n"
1554 "dotnet\tprocessorArchitecture\tMSIL\n"
1555 "dotnet\tpublicKeyToken\tabcdef0123456789\n"
1556 "dotnet\tculture\tneutral\n"
1557 "dotnet\tversion\t1.0.0.0\n"
1558 "dotnet_local\tName\tWine.Dotnet.Local.Assembly\n"
1559 "dotnet_local\tprocessorArchitecture\tMSIL\n"
1560 "dotnet_local\tpublicKeyToken\tabcdef0123456789\n"
1561 "dotnet_local\tculture\tneutral\n"
1562 "dotnet_local\tversion\t1.0.0.0\n";
1564 static const char pa_install_exec_seq_dat
[] =
1565 "Action\tCondition\tSequence\n"
1567 "InstallExecuteSequence\tAction\n"
1568 "LaunchConditions\t\t100\n"
1569 "CostInitialize\t\t800\n"
1571 "CostFinalize\t\t1000\n"
1572 "InstallValidate\t\t1400\n"
1573 "InstallInitialize\t\t1500\n"
1574 "ProcessComponents\t\t1600\n"
1575 "MsiPublishAssemblies\t\t3000\n"
1576 "MsiUnpublishAssemblies\t\t4000\n"
1577 "RegisterProduct\t\t5000\n"
1578 "PublishFeatures\t\t5100\n"
1579 "PublishProduct\t\t5200\n"
1580 "InstallFinalize\t\t6000\n";
1582 static const char rep_file_dat
[] =
1583 "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
1584 "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
1586 "rep.txt\trep\trep.txt\t1000\t\t\t8192\t1\n";
1588 static const char rep_feature_dat
[] =
1589 "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
1590 "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
1591 "Feature\tFeature\n"
1592 "rep\t\t\trep feature\t1\t2\tMSITESTDIR\t0\n";
1594 static const char rep_feature_comp_dat
[] =
1595 "Feature_\tComponent_\n"
1597 "FeatureComponents\tFeature_\tComponent_\n"
1600 static const char rep_component_dat
[] =
1601 "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
1602 "s72\tS38\ts72\ti2\tS255\tS72\n"
1603 "Component\tComponent\n"
1604 "rep\t{A24FAF2A-3B2E-41EF-AA78-331542E1A29D}\tMSITESTDIR\t0\t\trep.txt\n";
1606 static const char rep_upgrade_dat
[] =
1607 "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n"
1608 "s38\tS20\tS20\tS255\ti4\tS255\ts72\n"
1609 "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n"
1610 "{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\t\t\t\t256\t\tPRODUCT\n";
1612 static const char rep_property_dat
[] =
1615 "Property\tProperty\n"
1618 "InstallMode\tTypical\n"
1619 "Manufacturer\tWine\n"
1620 "PIDTemplate\t###-#######\n"
1621 "ProductCode\t{1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3}\n"
1622 "ProductLanguage\t1033\n"
1623 "ProductName\tMSITEST\n"
1624 "ProductVersion\t1.1.1\n"
1625 "UpgradeCode\t{2967C1CC-34D4-42EE-8D96-CD6836F192BF}\n"
1626 "PRODUCT\t2F41860D-7B4C-4DA7-BED9-B64F26594C56\n"
1627 "MSIFASTINSTALL\t1\n";
1629 static const char rep_install_exec_seq_dat
[] =
1630 "Action\tCondition\tSequence\n"
1632 "InstallExecuteSequence\tAction\n"
1633 "FindRelatedProducts\t\t100\n"
1634 "CostInitialize\t\t800\n"
1636 "CostFinalize\t\t1000\n"
1637 "InstallValidate\t\t1400\n"
1638 "RemoveExistingProducts\t\t1499\n"
1639 "InstallInitialize\t\t1500\n"
1640 "ProcessComponents\t\t1600\n"
1641 "RemoveFiles\t\t1700\n"
1642 "InstallFiles\t\t2000\n"
1643 "UnregisterExtensionInfo\t\t3000\n"
1644 "UnregisterMIMEInfo\t\t3500\n"
1645 "RegisterExtensionInfo\t\t4000\n"
1646 "RegisterMIMEInfo\t\t4500\n"
1647 "RegisterProduct\t\t5000\n"
1648 "PublishFeatures\t\t5100\n"
1649 "PublishProduct\t\t5200\n"
1650 "InstallFinalize\t\t6000\n";
1652 typedef struct _msi_table
1654 const char *filename
;
1659 #define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
1661 static const msi_table env_tables
[] =
1663 ADD_TABLE(component
),
1664 ADD_TABLE(directory
),
1666 ADD_TABLE(feature_comp
),
1668 ADD_TABLE(install_exec_seq
),
1670 ADD_TABLE(property
),
1671 ADD_TABLE(environment
)
1674 static const msi_table pp_tables
[] =
1676 ADD_TABLE(pp_component
),
1677 ADD_TABLE(directory
),
1678 ADD_TABLE(rof_feature
),
1679 ADD_TABLE(rof_feature_comp
),
1680 ADD_TABLE(rof_file
),
1681 ADD_TABLE(pp_install_exec_seq
),
1682 ADD_TABLE(rof_media
),
1683 ADD_TABLE(property
),
1686 static const msi_table ppc_tables
[] =
1688 ADD_TABLE(ppc_component
),
1689 ADD_TABLE(directory
),
1690 ADD_TABLE(rof_feature
),
1691 ADD_TABLE(ppc_feature_comp
),
1692 ADD_TABLE(ppc_file
),
1693 ADD_TABLE(pp_install_exec_seq
),
1694 ADD_TABLE(ppc_media
),
1695 ADD_TABLE(property
),
1698 static const msi_table rem_tables
[] =
1700 ADD_TABLE(rem_component
),
1701 ADD_TABLE(directory
),
1702 ADD_TABLE(rof_feature
),
1703 ADD_TABLE(rem_feature_comp
),
1704 ADD_TABLE(rem_file
),
1705 ADD_TABLE(rem_install_exec_seq
),
1706 ADD_TABLE(rof_media
),
1707 ADD_TABLE(property
),
1708 ADD_TABLE(rem_remove_files
),
1711 static const msi_table mov_tables
[] =
1713 ADD_TABLE(cwd_component
),
1714 ADD_TABLE(directory
),
1715 ADD_TABLE(rof_feature
),
1716 ADD_TABLE(ci2_feature_comp
),
1717 ADD_TABLE(ci2_file
),
1718 ADD_TABLE(install_exec_seq
),
1719 ADD_TABLE(rof_media
),
1720 ADD_TABLE(property
),
1721 ADD_TABLE(mov_move_file
),
1724 static const msi_table df_tables
[] =
1726 ADD_TABLE(rof_component
),
1727 ADD_TABLE(df_directory
),
1728 ADD_TABLE(rof_feature
),
1729 ADD_TABLE(rof_feature_comp
),
1730 ADD_TABLE(rof_file
),
1731 ADD_TABLE(install_exec_seq
),
1732 ADD_TABLE(rof_media
),
1733 ADD_TABLE(property
),
1734 ADD_TABLE(df_duplicate_file
),
1737 static const msi_table wrv_tables
[] =
1739 ADD_TABLE(wrv_component
),
1740 ADD_TABLE(directory
),
1741 ADD_TABLE(rof_feature
),
1742 ADD_TABLE(ci2_feature_comp
),
1743 ADD_TABLE(ci2_file
),
1744 ADD_TABLE(install_exec_seq
),
1745 ADD_TABLE(rof_media
),
1746 ADD_TABLE(property
),
1747 ADD_TABLE(wrv_registry
),
1750 static const msi_table cf_tables
[] =
1752 ADD_TABLE(cf_component
),
1753 ADD_TABLE(cf_directory
),
1754 ADD_TABLE(cf_feature
),
1755 ADD_TABLE(cf_feature_comp
),
1757 ADD_TABLE(cf_create_folders
),
1758 ADD_TABLE(cf_install_exec_seq
),
1763 static const msi_table sss_tables
[] =
1765 ADD_TABLE(component
),
1766 ADD_TABLE(directory
),
1768 ADD_TABLE(feature_comp
),
1770 ADD_TABLE(sss_install_exec_seq
),
1771 ADD_TABLE(sss_service_control
),
1776 static const msi_table sds_tables
[] =
1778 ADD_TABLE(component
),
1779 ADD_TABLE(directory
),
1781 ADD_TABLE(feature_comp
),
1783 ADD_TABLE(sds_install_exec_seq
),
1784 ADD_TABLE(service_control
),
1785 ADD_TABLE(service_install
),
1790 static const msi_table sis_tables
[] =
1792 ADD_TABLE(component
),
1793 ADD_TABLE(directory
),
1795 ADD_TABLE(feature_comp
),
1797 ADD_TABLE(sds_install_exec_seq
),
1798 ADD_TABLE(service_install2
),
1803 static const msi_table sr_tables
[] =
1805 ADD_TABLE(component
),
1806 ADD_TABLE(directory
),
1808 ADD_TABLE(feature_comp
),
1810 ADD_TABLE(sr_selfreg
),
1811 ADD_TABLE(sr_install_exec_seq
),
1816 static const msi_table font_tables
[] =
1818 ADD_TABLE(font_component
),
1819 ADD_TABLE(directory
),
1820 ADD_TABLE(font_feature
),
1821 ADD_TABLE(font_feature_comp
),
1822 ADD_TABLE(font_file
),
1824 ADD_TABLE(font_install_exec_seq
),
1825 ADD_TABLE(font_media
),
1829 static const msi_table vp_tables
[] =
1831 ADD_TABLE(component
),
1832 ADD_TABLE(directory
),
1834 ADD_TABLE(feature_comp
),
1836 ADD_TABLE(vp_custom_action
),
1837 ADD_TABLE(vp_install_exec_seq
),
1839 ADD_TABLE(vp_property
)
1842 static const msi_table odbc_tables
[] =
1844 ADD_TABLE(odbc_component
),
1845 ADD_TABLE(directory
),
1846 ADD_TABLE(odbc_feature
),
1847 ADD_TABLE(odbc_feature_comp
),
1848 ADD_TABLE(odbc_file
),
1849 ADD_TABLE(odbc_driver
),
1850 ADD_TABLE(odbc_translator
),
1851 ADD_TABLE(odbc_datasource
),
1852 ADD_TABLE(odbc_install_exec_seq
),
1853 ADD_TABLE(odbc_media
),
1857 static const msi_table tl_tables
[] =
1859 ADD_TABLE(tl_component
),
1860 ADD_TABLE(directory
),
1861 ADD_TABLE(tl_feature
),
1862 ADD_TABLE(tl_feature_comp
),
1864 ADD_TABLE(tl_typelib
),
1865 ADD_TABLE(tl_install_exec_seq
),
1870 static const msi_table crs_tables
[] =
1872 ADD_TABLE(crs_component
),
1873 ADD_TABLE(directory
),
1874 ADD_TABLE(crs_feature
),
1875 ADD_TABLE(crs_feature_comp
),
1876 ADD_TABLE(crs_file
),
1877 ADD_TABLE(crs_shortcut
),
1878 ADD_TABLE(crs_install_exec_seq
),
1883 static const msi_table pub_tables
[] =
1885 ADD_TABLE(directory
),
1886 ADD_TABLE(pub_component
),
1887 ADD_TABLE(pub_feature
),
1888 ADD_TABLE(pub_feature_comp
),
1889 ADD_TABLE(pub_file
),
1890 ADD_TABLE(pub_publish_component
),
1891 ADD_TABLE(pub_install_exec_seq
),
1896 static const msi_table rd_tables
[] =
1898 ADD_TABLE(directory
),
1899 ADD_TABLE(rd_component
),
1900 ADD_TABLE(rd_feature
),
1901 ADD_TABLE(rd_feature_comp
),
1903 ADD_TABLE(rd_duplicate_file
),
1904 ADD_TABLE(rd_install_exec_seq
),
1909 static const msi_table rrv_tables
[] =
1911 ADD_TABLE(directory
),
1912 ADD_TABLE(rrv_component
),
1913 ADD_TABLE(rrv_feature
),
1914 ADD_TABLE(rrv_feature_comp
),
1915 ADD_TABLE(rrv_file
),
1916 ADD_TABLE(rrv_registry
),
1917 ADD_TABLE(rrv_remove_registry
),
1918 ADD_TABLE(rrv_install_exec_seq
),
1923 static const msi_table frp_tables
[] =
1925 ADD_TABLE(directory
),
1926 ADD_TABLE(frp_component
),
1927 ADD_TABLE(frp_feature
),
1928 ADD_TABLE(frp_feature_comp
),
1929 ADD_TABLE(frp_file
),
1930 ADD_TABLE(frp_upgrade
),
1931 ADD_TABLE(frp_custom_action
),
1932 ADD_TABLE(frp_install_exec_seq
),
1937 static const msi_table riv_tables
[] =
1939 ADD_TABLE(directory
),
1940 ADD_TABLE(riv_component
),
1941 ADD_TABLE(riv_feature
),
1942 ADD_TABLE(riv_feature_comp
),
1943 ADD_TABLE(riv_file
),
1944 ADD_TABLE(riv_ini_file
),
1945 ADD_TABLE(riv_remove_ini_file
),
1946 ADD_TABLE(riv_install_exec_seq
),
1951 static const msi_table res_tables
[] =
1953 ADD_TABLE(directory
),
1954 ADD_TABLE(res_component
),
1955 ADD_TABLE(res_feature
),
1956 ADD_TABLE(res_feature_comp
),
1957 ADD_TABLE(res_file
),
1958 ADD_TABLE(res_environment
),
1959 ADD_TABLE(res_install_exec_seq
),
1964 static const msi_table rci_tables
[] =
1966 ADD_TABLE(directory
),
1967 ADD_TABLE(rci_component
),
1968 ADD_TABLE(rci_feature
),
1969 ADD_TABLE(rci_feature_comp
),
1970 ADD_TABLE(rci_file
),
1971 ADD_TABLE(rci_appid
),
1972 ADD_TABLE(rci_class
),
1973 ADD_TABLE(rci_install_exec_seq
),
1978 static const msi_table rei_tables
[] =
1980 ADD_TABLE(directory
),
1981 ADD_TABLE(rei_component
),
1982 ADD_TABLE(rei_feature
),
1983 ADD_TABLE(rei_feature_comp
),
1984 ADD_TABLE(rei_file
),
1985 ADD_TABLE(rei_extension
),
1986 ADD_TABLE(rei_verb
),
1987 ADD_TABLE(rei_progid
),
1988 ADD_TABLE(rei_install_exec_seq
),
1993 static const msi_table rpi_tables
[] =
1995 ADD_TABLE(directory
),
1996 ADD_TABLE(rpi_component
),
1997 ADD_TABLE(rpi_feature
),
1998 ADD_TABLE(rpi_feature_comp
),
1999 ADD_TABLE(rpi_file
),
2000 ADD_TABLE(rpi_appid
),
2001 ADD_TABLE(rpi_class
),
2002 ADD_TABLE(rpi_extension
),
2003 ADD_TABLE(rpi_verb
),
2004 ADD_TABLE(rpi_progid
),
2005 ADD_TABLE(rpi_install_exec_seq
),
2010 static const msi_table rmi_tables
[] =
2012 ADD_TABLE(directory
),
2013 ADD_TABLE(rmi_component
),
2014 ADD_TABLE(rmi_feature
),
2015 ADD_TABLE(rmi_feature_comp
),
2016 ADD_TABLE(rmi_file
),
2017 ADD_TABLE(rmi_extension
),
2018 ADD_TABLE(rmi_verb
),
2019 ADD_TABLE(rmi_mime
),
2020 ADD_TABLE(rmi_install_exec_seq
),
2025 static const msi_table pa_tables
[] =
2027 ADD_TABLE(directory
),
2028 ADD_TABLE(pa_component
),
2029 ADD_TABLE(pa_feature
),
2030 ADD_TABLE(pa_feature_comp
),
2032 ADD_TABLE(pa_msi_assembly
),
2033 ADD_TABLE(pa_msi_assembly_name
),
2034 ADD_TABLE(pa_install_exec_seq
),
2039 static const msi_table rep_tables
[] =
2041 ADD_TABLE(directory
),
2042 ADD_TABLE(rep_component
),
2043 ADD_TABLE(rep_feature
),
2044 ADD_TABLE(rep_feature_comp
),
2045 ADD_TABLE(rep_file
),
2046 ADD_TABLE(rep_upgrade
),
2047 ADD_TABLE(rep_property
),
2048 ADD_TABLE(rep_install_exec_seq
),
2052 /* based on RegDeleteTreeW from dlls/advapi32/registry.c */
2053 static LSTATUS
action_RegDeleteTreeA(HKEY hKey
, LPCSTR lpszSubKey
, REGSAM access
)
2056 DWORD dwMaxSubkeyLen
, dwMaxValueLen
;
2057 DWORD dwMaxLen
, dwSize
;
2058 char szNameBuf
[MAX_PATH
], *lpszName
= szNameBuf
;
2059 HKEY hSubKey
= hKey
;
2063 ret
= RegOpenKeyExA(hKey
, lpszSubKey
, 0, access
, &hSubKey
);
2064 if (ret
) return ret
;
2067 ret
= RegQueryInfoKeyA(hSubKey
, NULL
, NULL
, NULL
, NULL
,
2068 &dwMaxSubkeyLen
, NULL
, NULL
, &dwMaxValueLen
, NULL
, NULL
, NULL
);
2069 if (ret
) goto cleanup
;
2073 dwMaxLen
= max(dwMaxSubkeyLen
, dwMaxValueLen
);
2074 if (dwMaxLen
> sizeof(szNameBuf
))
2076 /* Name too big: alloc a buffer for it */
2077 if (!(lpszName
= HeapAlloc( GetProcessHeap(), 0, dwMaxLen
)))
2079 ret
= ERROR_NOT_ENOUGH_MEMORY
;
2084 /* Recursively delete all the subkeys */
2088 if (RegEnumKeyExA(hSubKey
, 0, lpszName
, &dwSize
, NULL
,
2089 NULL
, NULL
, NULL
)) break;
2091 ret
= action_RegDeleteTreeA(hSubKey
, lpszName
, access
);
2092 if (ret
) goto cleanup
;
2097 if (pRegDeleteKeyExA
)
2098 ret
= pRegDeleteKeyExA(hKey
, lpszSubKey
, access
, 0);
2100 ret
= RegDeleteKeyA(hKey
, lpszSubKey
);
2106 if (RegEnumValueA(hKey
, 0, lpszName
, &dwSize
,
2107 NULL
, NULL
, NULL
, NULL
)) break;
2109 ret
= RegDeleteValueA(hKey
, lpszName
);
2110 if (ret
) goto cleanup
;
2114 if (lpszName
!= szNameBuf
)
2115 HeapFree(GetProcessHeap(), 0, lpszName
);
2117 RegCloseKey(hSubKey
);
2121 /* cabinet definitions */
2123 /* make the max size large so there is only one cab file */
2124 #define MEDIA_SIZE 0x7FFFFFFF
2125 #define FOLDER_THRESHOLD 900000
2127 /* the FCI callbacks */
2129 static void * CDECL
mem_alloc(ULONG cb
)
2131 return HeapAlloc(GetProcessHeap(), 0, cb
);
2134 static void CDECL
mem_free(void *memory
)
2136 HeapFree(GetProcessHeap(), 0, memory
);
2139 static BOOL CDECL
get_next_cabinet(PCCAB pccab
, ULONG cbPrevCab
, void *pv
)
2141 sprintf(pccab
->szCab
, pv
, pccab
->iCab
);
2145 static LONG CDECL
progress(UINT typeStatus
, ULONG cb1
, ULONG cb2
, void *pv
)
2150 static int CDECL
file_placed(PCCAB pccab
, char *pszFile
, LONG cbFile
,
2151 BOOL fContinuation
, void *pv
)
2156 static INT_PTR CDECL
fci_open(char *pszFile
, int oflag
, int pmode
, int *err
, void *pv
)
2160 DWORD dwShareMode
= 0;
2161 DWORD dwCreateDisposition
= OPEN_EXISTING
;
2163 dwAccess
= GENERIC_READ
| GENERIC_WRITE
;
2164 dwShareMode
= FILE_SHARE_READ
| FILE_SHARE_WRITE
| FILE_SHARE_DELETE
;
2166 if (GetFileAttributesA(pszFile
) != INVALID_FILE_ATTRIBUTES
)
2167 dwCreateDisposition
= OPEN_EXISTING
;
2169 dwCreateDisposition
= CREATE_NEW
;
2171 handle
= CreateFileA(pszFile
, dwAccess
, dwShareMode
, NULL
,
2172 dwCreateDisposition
, 0, NULL
);
2174 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszFile
);
2176 return (INT_PTR
)handle
;
2179 static UINT CDECL
fci_read(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2181 HANDLE handle
= (HANDLE
)hf
;
2185 res
= ReadFile(handle
, memory
, cb
, &dwRead
, NULL
);
2186 ok(res
, "Failed to ReadFile\n");
2191 static UINT CDECL
fci_write(INT_PTR hf
, void *memory
, UINT cb
, int *err
, void *pv
)
2193 HANDLE handle
= (HANDLE
)hf
;
2197 res
= WriteFile(handle
, memory
, cb
, &dwWritten
, NULL
);
2198 ok(res
, "Failed to WriteFile\n");
2203 static int CDECL
fci_close(INT_PTR hf
, int *err
, void *pv
)
2205 HANDLE handle
= (HANDLE
)hf
;
2206 ok(CloseHandle(handle
), "Failed to CloseHandle\n");
2211 static LONG CDECL
fci_seek(INT_PTR hf
, LONG dist
, int seektype
, int *err
, void *pv
)
2213 HANDLE handle
= (HANDLE
)hf
;
2216 ret
= SetFilePointer(handle
, dist
, NULL
, seektype
);
2217 ok(ret
!= INVALID_SET_FILE_POINTER
, "Failed to SetFilePointer\n");
2222 static int CDECL
fci_delete(char *pszFile
, int *err
, void *pv
)
2224 BOOL ret
= DeleteFileA(pszFile
);
2225 ok(ret
, "Failed to DeleteFile %s\n", pszFile
);
2230 static void init_functionpointers(void)
2232 HMODULE hmsi
= GetModuleHandleA("msi.dll");
2233 HMODULE hadvapi32
= GetModuleHandleA("advapi32.dll");
2234 HMODULE hkernel32
= GetModuleHandleA("kernel32.dll");
2236 #define GET_PROC(mod, func) \
2237 p ## func = (void*)GetProcAddress(mod, #func); \
2239 trace("GetProcAddress(%s) failed\n", #func);
2241 GET_PROC(hmsi
, MsiQueryComponentStateA
);
2242 GET_PROC(hmsi
, MsiSourceListEnumSourcesA
);
2243 GET_PROC(hmsi
, MsiSourceListGetInfoA
);
2244 GET_PROC(hmsi
, MsiGetComponentPathExA
);
2245 GET_PROC(hmsi
, MsiQueryFeatureStateExA
);
2247 GET_PROC(hadvapi32
, CheckTokenMembership
);
2248 GET_PROC(hadvapi32
, ConvertSidToStringSidA
);
2249 GET_PROC(hadvapi32
, OpenProcessToken
);
2250 GET_PROC(hadvapi32
, RegDeleteKeyExA
)
2251 GET_PROC(hkernel32
, IsWow64Process
)
2253 hsrclient
= LoadLibraryA("srclient.dll");
2254 GET_PROC(hsrclient
, SRRemoveRestorePoint
);
2255 GET_PROC(hsrclient
, SRSetRestorePointA
);
2260 static BOOL
is_process_limited(void)
2262 SID_IDENTIFIER_AUTHORITY NtAuthority
= {SECURITY_NT_AUTHORITY
};
2267 if (!pCheckTokenMembership
|| !pOpenProcessToken
) return FALSE
;
2269 if (!AllocateAndInitializeSid(&NtAuthority
, 2, SECURITY_BUILTIN_DOMAIN_RID
,
2270 DOMAIN_ALIAS_RID_ADMINS
, 0, 0, 0, 0, 0, 0, &Group
) ||
2271 !pCheckTokenMembership(NULL
, Group
, &IsInGroup
))
2273 trace("Could not check if the current user is an administrator\n");
2281 /* Only administrators have enough privileges for these tests */
2285 if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
))
2288 TOKEN_ELEVATION_TYPE type
= TokenElevationTypeDefault
;
2291 ret
= GetTokenInformation(token
, TokenElevationType
, &type
, sizeof(type
), &size
);
2293 return (ret
&& type
== TokenElevationTypeLimited
);
2298 static char *get_user_sid(void)
2303 char *usersid
= NULL
;
2305 if (!pConvertSidToStringSidA
)
2307 win_skip("ConvertSidToStringSidA is not available\n");
2310 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY
, &token
);
2311 GetTokenInformation(token
, TokenUser
, NULL
, size
, &size
);
2313 user
= HeapAlloc(GetProcessHeap(), 0, size
);
2314 GetTokenInformation(token
, TokenUser
, user
, size
, &size
);
2315 pConvertSidToStringSidA(user
->User
.Sid
, &usersid
);
2316 HeapFree(GetProcessHeap(), 0, user
);
2322 static BOOL CDECL
get_temp_file(char *pszTempName
, int cbTempName
, void *pv
)
2326 tempname
= HeapAlloc(GetProcessHeap(), 0, MAX_PATH
);
2327 GetTempFileNameA(".", "xx", 0, tempname
);
2329 if (tempname
&& (strlen(tempname
) < (unsigned)cbTempName
))
2331 lstrcpyA(pszTempName
, tempname
);
2332 HeapFree(GetProcessHeap(), 0, tempname
);
2336 HeapFree(GetProcessHeap(), 0, tempname
);
2341 static INT_PTR CDECL
get_open_info(char *pszName
, USHORT
*pdate
, USHORT
*ptime
,
2342 USHORT
*pattribs
, int *err
, void *pv
)
2344 BY_HANDLE_FILE_INFORMATION finfo
;
2350 handle
= CreateFileA(pszName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
2351 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_SEQUENTIAL_SCAN
, NULL
);
2353 ok(handle
!= INVALID_HANDLE_VALUE
, "Failed to CreateFile %s\n", pszName
);
2355 res
= GetFileInformationByHandle(handle
, &finfo
);
2356 ok(res
, "Expected GetFileInformationByHandle to succeed\n");
2358 FileTimeToLocalFileTime(&finfo
.ftLastWriteTime
, &filetime
);
2359 FileTimeToDosDateTime(&filetime
, pdate
, ptime
);
2361 attrs
= GetFileAttributesA(pszName
);
2362 ok(attrs
!= INVALID_FILE_ATTRIBUTES
, "Failed to GetFileAttributes\n");
2364 return (INT_PTR
)handle
;
2367 static BOOL
add_file(HFCI hfci
, const char *file
, TCOMP compress
)
2369 char path
[MAX_PATH
];
2370 char filename
[MAX_PATH
];
2372 lstrcpyA(path
, CURR_DIR
);
2373 lstrcatA(path
, "\\");
2374 lstrcatA(path
, file
);
2376 lstrcpyA(filename
, file
);
2378 return FCIAddFile(hfci
, path
, filename
, FALSE
, get_next_cabinet
,
2379 progress
, get_open_info
, compress
);
2382 static void set_cab_parameters(PCCAB pCabParams
, const CHAR
*name
, DWORD max_size
)
2384 ZeroMemory(pCabParams
, sizeof(CCAB
));
2386 pCabParams
->cb
= max_size
;
2387 pCabParams
->cbFolderThresh
= FOLDER_THRESHOLD
;
2388 pCabParams
->setID
= 0xbeef;
2389 pCabParams
->iCab
= 1;
2390 lstrcpyA(pCabParams
->szCabPath
, CURR_DIR
);
2391 lstrcatA(pCabParams
->szCabPath
, "\\");
2392 lstrcpyA(pCabParams
->szCab
, name
);
2395 static void create_cab_file(const CHAR
*name
, DWORD max_size
, const CHAR
*files
)
2403 set_cab_parameters(&cabParams
, name
, max_size
);
2405 hfci
= FCICreate(&erf
, file_placed
, mem_alloc
, mem_free
, fci_open
,
2406 fci_read
, fci_write
, fci_close
, fci_seek
, fci_delete
,
2407 get_temp_file
, &cabParams
, NULL
);
2409 ok(hfci
!= NULL
, "Failed to create an FCI context\n");
2414 res
= add_file(hfci
, ptr
, tcompTYPE_MSZIP
);
2415 ok(res
, "Failed to add file: %s\n", ptr
);
2416 ptr
+= lstrlenA(ptr
) + 1;
2419 res
= FCIFlushCabinet(hfci
, FALSE
, get_next_cabinet
, progress
);
2420 ok(res
, "Failed to flush the cabinet\n");
2422 res
= FCIDestroy(hfci
);
2423 ok(res
, "Failed to destroy the cabinet\n");
2426 static BOOL
get_user_dirs(void)
2431 if (RegOpenKeyA(HKEY_CURRENT_USER
,
2432 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey
))
2436 if (RegQueryValueExA(hkey
, "AppData", 0, &type
, (LPBYTE
)APP_DATA_DIR
, &size
))
2446 static BOOL
get_system_dirs(void)
2451 if (RegOpenKeyA(HKEY_LOCAL_MACHINE
,
2452 "Software\\Microsoft\\Windows\\CurrentVersion", &hkey
))
2456 if (RegQueryValueExA(hkey
, "ProgramFilesDir (x86)", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
) &&
2457 RegQueryValueExA(hkey
, "ProgramFilesDir", 0, &type
, (LPBYTE
)PROG_FILES_DIR
, &size
))
2464 if (RegQueryValueExA(hkey
, "CommonFilesDir (x86)", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
) &&
2465 RegQueryValueExA(hkey
, "CommonFilesDir", 0, &type
, (LPBYTE
)COMMON_FILES_DIR
, &size
))
2473 if (!GetWindowsDirectoryA(WINDOWS_DIR
, MAX_PATH
))
2479 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
2484 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
2485 if (file
== INVALID_HANDLE_VALUE
)
2488 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
2492 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
2499 #define create_file(name, size) create_file_data(name, name, size)
2501 static void create_test_files(void)
2503 CreateDirectoryA("msitest", NULL
);
2504 create_file("msitest\\one.txt", 100);
2505 CreateDirectoryA("msitest\\first", NULL
);
2506 create_file("msitest\\first\\two.txt", 100);
2507 CreateDirectoryA("msitest\\second", NULL
);
2508 create_file("msitest\\second\\three.txt", 100);
2510 create_file("four.txt", 100);
2511 create_file("five.txt", 100);
2512 create_cab_file("msitest.cab", MEDIA_SIZE
, "four.txt\0five.txt\0");
2514 create_file("msitest\\filename", 100);
2515 create_file("msitest\\service.exe", 100);
2516 create_file("msitest\\service2.exe", 100);
2518 DeleteFileA("four.txt");
2519 DeleteFileA("five.txt");
2522 static BOOL
delete_pf(const CHAR
*rel_path
, BOOL is_file
)
2524 CHAR path
[MAX_PATH
];
2526 lstrcpyA(path
, PROG_FILES_DIR
);
2527 lstrcatA(path
, "\\");
2528 lstrcatA(path
, rel_path
);
2531 return DeleteFileA(path
);
2533 return RemoveDirectoryA(path
);
2536 static void delete_test_files(void)
2538 DeleteFileA("msitest.msi");
2539 DeleteFileA("msitest.cab");
2540 DeleteFileA("msitest\\second\\three.txt");
2541 DeleteFileA("msitest\\first\\two.txt");
2542 DeleteFileA("msitest\\one.txt");
2543 DeleteFileA("msitest\\service.exe");
2544 DeleteFileA("msitest\\service2.exe");
2545 DeleteFileA("msitest\\filename");
2546 RemoveDirectoryA("msitest\\second");
2547 RemoveDirectoryA("msitest\\first");
2548 RemoveDirectoryA("msitest");
2551 static void write_file(const CHAR
*filename
, const char *data
, int data_size
)
2554 HANDLE hf
= CreateFileA(filename
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
2555 WriteFile(hf
, data
, data_size
, &size
, NULL
);
2559 static void write_msi_summary_info(MSIHANDLE db
, INT version
, INT wordcount
, const char *template)
2564 r
= MsiGetSummaryInformationA(db
, NULL
, 5, &summary
);
2565 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2567 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TEMPLATE
, VT_LPSTR
, 0, NULL
, template);
2568 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2570 r
= MsiSummaryInfoSetPropertyA(summary
, PID_REVNUMBER
, VT_LPSTR
, 0, NULL
,
2571 "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
2572 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2574 r
= MsiSummaryInfoSetPropertyA(summary
, PID_PAGECOUNT
, VT_I4
, version
, NULL
, NULL
);
2575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2577 r
= MsiSummaryInfoSetPropertyA(summary
, PID_WORDCOUNT
, VT_I4
, wordcount
, NULL
, NULL
);
2578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2580 r
= MsiSummaryInfoSetPropertyA(summary
, PID_TITLE
, VT_LPSTR
, 0, NULL
, "MSITEST");
2581 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2583 /* write the summary changes back to the stream */
2584 r
= MsiSummaryInfoPersist(summary
);
2585 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2587 MsiCloseHandle(summary
);
2590 #define create_database(name, tables, num_tables) \
2591 create_database_wordcount(name, tables, num_tables, 100, 0, ";1033");
2593 #define create_database_template(name, tables, num_tables, version, template) \
2594 create_database_wordcount(name, tables, num_tables, version, 0, template);
2596 static void create_database_wordcount(const CHAR
*name
, const msi_table
*tables
,
2597 int num_tables
, INT version
, INT wordcount
,
2598 const char *template)
2605 len
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
2606 if (!(nameW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return;
2607 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, len
);
2609 r
= MsiOpenDatabaseW(nameW
, MSIDBOPEN_CREATE
, &db
);
2610 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2612 /* import the tables into the database */
2613 for (j
= 0; j
< num_tables
; j
++)
2615 const msi_table
*table
= &tables
[j
];
2617 write_file(table
->filename
, table
->data
, (table
->size
- 1) * sizeof(char));
2619 r
= MsiDatabaseImportA(db
, CURR_DIR
, table
->filename
);
2620 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2622 DeleteFileA(table
->filename
);
2625 write_msi_summary_info(db
, version
, wordcount
, template);
2627 r
= MsiDatabaseCommit(db
);
2628 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
2631 HeapFree( GetProcessHeap(), 0, nameW
);
2634 static BOOL
notify_system_change(DWORD event_type
, STATEMGRSTATUS
*status
)
2636 RESTOREPOINTINFOA spec
;
2638 spec
.dwEventType
= event_type
;
2639 spec
.dwRestorePtType
= APPLICATION_INSTALL
;
2640 spec
.llSequenceNumber
= status
->llSequenceNumber
;
2641 lstrcpyA(spec
.szDescription
, "msitest restore point");
2643 return pSRSetRestorePointA(&spec
, status
);
2646 static void remove_restore_point(DWORD seq_number
)
2650 res
= pSRRemoveRestorePoint(seq_number
);
2651 if (res
!= ERROR_SUCCESS
)
2652 trace("Failed to remove the restore point : %08x\n", res
);
2655 static LONG
delete_key( HKEY key
, LPCSTR subkey
, REGSAM access
)
2657 if (pRegDeleteKeyExA
)
2658 return pRegDeleteKeyExA( key
, subkey
, access
, 0 );
2659 return RegDeleteKeyA( key
, subkey
);
2662 static BOOL
file_exists(LPCSTR file
)
2664 return GetFileAttributesA(file
) != INVALID_FILE_ATTRIBUTES
;
2667 static BOOL
pf_exists(LPCSTR file
)
2669 CHAR path
[MAX_PATH
];
2671 lstrcpyA(path
, PROG_FILES_DIR
);
2672 lstrcatA(path
, "\\");
2673 lstrcatA(path
, file
);
2675 return file_exists(path
);
2678 static void delete_pfmsitest_files(void)
2680 SHFILEOPSTRUCTA shfl
;
2681 CHAR path
[MAX_PATH
+11];
2683 lstrcpyA(path
, PROG_FILES_DIR
);
2684 lstrcatA(path
, "\\msitest\\*");
2685 path
[strlen(path
) + 1] = '\0';
2688 shfl
.wFunc
= FO_DELETE
;
2691 shfl
.fFlags
= FOF_FILESONLY
| FOF_NOCONFIRMATION
| FOF_NORECURSION
| FOF_SILENT
| FOF_NOERRORUI
;
2693 SHFileOperationA(&shfl
);
2695 lstrcpyA(path
, PROG_FILES_DIR
);
2696 lstrcatA(path
, "\\msitest");
2697 RemoveDirectoryA(path
);
2700 static void check_reg_str(HKEY prodkey
, LPCSTR name
, LPCSTR expected
, BOOL bcase
, DWORD line
)
2708 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)val
, &size
);
2710 if (res
!= ERROR_SUCCESS
||
2711 (type
!= REG_SZ
&& type
!= REG_EXPAND_SZ
&& type
!= REG_MULTI_SZ
))
2713 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2718 ok_(__FILE__
, line
)(!val
[0], "Expected empty string, got %s\n", val
);
2722 ok_(__FILE__
, line
)(!lstrcmpA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2724 ok_(__FILE__
, line
)(!lstrcmpiA(val
, expected
), "Expected %s, got %s\n", expected
, val
);
2728 static void check_reg_dword(HKEY prodkey
, LPCSTR name
, DWORD expected
, DWORD line
)
2730 DWORD val
, size
, type
;
2733 size
= sizeof(DWORD
);
2734 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2736 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2738 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2742 ok_(__FILE__
, line
)(val
== expected
, "Expected %d, got %d\n", expected
, val
);
2745 static void check_reg_dword4(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2746 DWORD expected4
, DWORD line
)
2748 DWORD val
, size
, type
;
2751 size
= sizeof(DWORD
);
2752 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2754 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2756 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2760 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
,
2761 "Expected %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, val
);
2764 static void check_reg_dword5(HKEY prodkey
, LPCSTR name
, DWORD expected1
, DWORD expected2
, DWORD expected3
,
2765 DWORD expected4
, DWORD expected5
, DWORD line
)
2767 DWORD val
, size
, type
;
2770 size
= sizeof(DWORD
);
2771 res
= RegQueryValueExA(prodkey
, name
, NULL
, &type
, (LPBYTE
)&val
, &size
);
2773 if (res
!= ERROR_SUCCESS
|| type
!= REG_DWORD
)
2775 ok_(__FILE__
, line
)(FALSE
, "Key doesn't exist or wrong type\n");
2779 ok_(__FILE__
, line
)(val
== expected1
|| val
== expected2
|| val
== expected3
|| val
== expected4
||
2781 "Expected %d, %d, %d, %d or %d, got %d\n", expected1
, expected2
, expected3
, expected4
, expected5
, val
);
2784 #define CHECK_REG_STR(prodkey, name, expected) \
2785 check_reg_str(prodkey, name, expected, TRUE, __LINE__);
2787 #define CHECK_DEL_REG_STR(prodkey, name, expected) \
2789 check_reg_str(prodkey, name, expected, TRUE, __LINE__); \
2790 RegDeleteValueA(prodkey, name); \
2793 #define CHECK_REG_ISTR(prodkey, name, expected) \
2794 check_reg_str(prodkey, name, expected, FALSE, __LINE__);
2796 #define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2798 check_reg_str(prodkey, name, expected, FALSE, __LINE__); \
2799 RegDeleteValueA(prodkey, name); \
2802 #define CHECK_REG_DWORD(prodkey, name, expected) \
2803 check_reg_dword(prodkey, name, expected, __LINE__);
2805 #define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2807 check_reg_dword(prodkey, name, expected, __LINE__); \
2808 RegDeleteValueA(prodkey, name); \
2811 #define CHECK_REG_DWORD2(prodkey, name, expected1, expected2) \
2812 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__);
2814 #define CHECK_DEL_REG_DWORD2(prodkey, name, expected1, expected2) \
2816 check_reg_dword2(prodkey, name, expected1, expected2, __LINE__); \
2817 RegDeleteValueA(prodkey, name); \
2820 #define CHECK_REG_DWORD4(prodkey, name, expected1, expected2, expected3, expected4) \
2821 check_reg_dword4(prodkey, name, expected1, expected2, expected3, expected4, __LINE__);
2823 #define CHECK_DEL_REG_DWORD5(prodkey, name, expected1, expected2, expected3, expected4 ,expected5) \
2825 check_reg_dword5(prodkey, name, expected1, expected2, expected3, expected4, expected5, __LINE__); \
2826 RegDeleteValueA(prodkey, name); \
2829 static void get_date_str(LPSTR date
)
2833 static const char date_fmt
[] = "%d%02d%02d";
2834 GetLocalTime(&systime
);
2835 sprintf(date
, date_fmt
, systime
.wYear
, systime
.wMonth
, systime
.wDay
);
2838 static void test_register_product(void)
2842 HKEY hkey
, props
, usage
;
2844 char date
[MAX_PATH
], temp
[MAX_PATH
], keypath
[MAX_PATH
], path
[MAX_PATH
];
2846 REGSAM access
= KEY_ALL_ACCESS
;
2848 static const CHAR uninstall
[] = "Software\\Microsoft\\Windows\\CurrentVersion"
2849 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2850 static const CHAR uninstall_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion"
2851 "\\Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
2852 static const CHAR userdata
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2853 "\\UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
2854 static const CHAR ugkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
2855 "\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
2856 static const CHAR userugkey
[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
2857 "\\51AAE0C44620A5E4788506E91F249BD2";
2859 if (is_process_limited())
2861 skip("process is limited\n");
2865 if (!(usersid
= get_user_sid()))
2869 GetTempPathA(MAX_PATH
, temp
);
2871 CreateDirectoryA("msitest", NULL
);
2872 create_file("msitest\\maximus", 500);
2874 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
2877 access
|= KEY_WOW64_64KEY
;
2879 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
2881 /* RegisterProduct */
2882 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
2883 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
2885 skip("Not enough rights to perform tests\n");
2888 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
2889 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
2890 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
2892 res
= RegOpenKeyA(HKEY_CURRENT_USER
, userugkey
, &hkey
);
2893 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
2897 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
2898 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2902 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
2903 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2906 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
2907 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
2908 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
2909 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
2910 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2911 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
2912 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2913 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
2914 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
2915 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
2916 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
2917 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
2918 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
2919 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
2920 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
2921 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
2922 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
2923 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
2924 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
2925 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
2926 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
2927 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
2930 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
2933 delete_key(hkey
, "", access
);
2936 sprintf(keypath
, userdata
, usersid
);
2937 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
2938 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2940 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
2941 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2943 size
= sizeof(path
);
2944 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
2946 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
2948 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
2949 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
2950 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
2951 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
2952 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2953 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
2954 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
2955 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
2956 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
2957 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
2958 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
2959 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
2960 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
2961 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
2962 CHECK_DEL_REG_STR(props
, "Size", NULL
);
2963 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
2964 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
2965 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
2966 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
2967 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
2968 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
2969 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
2972 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
2975 delete_key(props
, "", access
);
2978 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
2981 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2984 delete_key(usage
, "", access
);
2986 delete_key(hkey
, "", access
);
2989 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
2990 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
2992 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
2994 delete_key(hkey
, "", access
);
2997 /* RegisterProduct, machine */
2998 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 ALLUSERS=1");
2999 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3000 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3001 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3003 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, userugkey
, 0, access
, &hkey
);
3004 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3008 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall_32node
, 0, KEY_ALL_ACCESS
, &hkey
);
3009 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3013 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, uninstall
, 0, KEY_ALL_ACCESS
, &hkey
);
3014 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3017 CHECK_DEL_REG_STR(hkey
, "DisplayName", "MSITEST");
3018 CHECK_DEL_REG_STR(hkey
, "DisplayVersion", "1.1.1");
3019 CHECK_DEL_REG_STR(hkey
, "InstallDate", date
);
3020 CHECK_DEL_REG_STR(hkey
, "InstallSource", temp
);
3021 CHECK_DEL_REG_ISTR(hkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3022 CHECK_DEL_REG_STR(hkey
, "Publisher", "Wine");
3023 CHECK_DEL_REG_STR(hkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3024 CHECK_DEL_REG_STR(hkey
, "AuthorizedCDFPrefix", NULL
);
3025 CHECK_DEL_REG_STR(hkey
, "Comments", NULL
);
3026 CHECK_DEL_REG_STR(hkey
, "Contact", NULL
);
3027 CHECK_DEL_REG_STR(hkey
, "HelpLink", NULL
);
3028 CHECK_DEL_REG_STR(hkey
, "HelpTelephone", NULL
);
3029 CHECK_DEL_REG_STR(hkey
, "InstallLocation", NULL
);
3030 CHECK_DEL_REG_STR(hkey
, "Readme", NULL
);
3031 CHECK_DEL_REG_STR(hkey
, "Size", NULL
);
3032 CHECK_DEL_REG_STR(hkey
, "URLInfoAbout", NULL
);
3033 CHECK_DEL_REG_STR(hkey
, "URLUpdateInfo", NULL
);
3034 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3035 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3036 CHECK_DEL_REG_DWORD(hkey
, "VersionMajor", 1);
3037 CHECK_DEL_REG_DWORD(hkey
, "VersionMinor", 1);
3038 CHECK_DEL_REG_DWORD(hkey
, "WindowsInstaller", 1);
3041 CHECK_DEL_REG_DWORD5(hkey
, "EstimatedSize", 12, -12, 4, 10, 24);
3044 delete_key(hkey
, "", access
);
3047 sprintf(keypath
, userdata
, "S-1-5-18");
3048 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3049 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3051 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3052 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3054 size
= sizeof(path
);
3055 RegQueryValueExA(props
, "LocalPackage", NULL
, &type
, (LPBYTE
)path
, &size
);
3057 RegDeleteValueA(props
, "LocalPackage"); /* LocalPackage is nondeterministic */
3059 CHECK_DEL_REG_STR(props
, "DisplayName", "MSITEST");
3060 CHECK_DEL_REG_STR(props
, "DisplayVersion", "1.1.1");
3061 CHECK_DEL_REG_STR(props
, "InstallDate", date
);
3062 CHECK_DEL_REG_STR(props
, "InstallSource", temp
);
3063 CHECK_DEL_REG_ISTR(props
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3064 CHECK_DEL_REG_STR(props
, "Publisher", "Wine");
3065 CHECK_DEL_REG_STR(props
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3066 CHECK_DEL_REG_STR(props
, "AuthorizedCDFPrefix", NULL
);
3067 CHECK_DEL_REG_STR(props
, "Comments", NULL
);
3068 CHECK_DEL_REG_STR(props
, "Contact", NULL
);
3069 CHECK_DEL_REG_STR(props
, "HelpLink", NULL
);
3070 CHECK_DEL_REG_STR(props
, "HelpTelephone", NULL
);
3071 CHECK_DEL_REG_STR(props
, "InstallLocation", NULL
);
3072 CHECK_DEL_REG_STR(props
, "Readme", NULL
);
3073 CHECK_DEL_REG_STR(props
, "Size", NULL
);
3074 CHECK_DEL_REG_STR(props
, "URLInfoAbout", NULL
);
3075 CHECK_DEL_REG_STR(props
, "URLUpdateInfo", NULL
);
3076 CHECK_DEL_REG_DWORD(props
, "Language", 1033);
3077 CHECK_DEL_REG_DWORD(props
, "Version", 0x1010001);
3078 CHECK_DEL_REG_DWORD(props
, "VersionMajor", 1);
3079 CHECK_DEL_REG_DWORD(props
, "VersionMinor", 1);
3080 CHECK_DEL_REG_DWORD(props
, "WindowsInstaller", 1);
3083 CHECK_DEL_REG_DWORD5(props
, "EstimatedSize", 12, -12, 4, 10, 24);
3086 delete_key(props
, "", access
);
3089 res
= RegOpenKeyExA(hkey
, "Usage", 0, access
, &usage
);
3092 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3095 delete_key(usage
, "", access
);
3097 delete_key(hkey
, "", access
);
3100 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ugkey
, 0, access
, &hkey
);
3101 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3103 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3105 delete_key(hkey
, "", access
);
3109 DeleteFileA(msifile
);
3110 DeleteFileA("msitest\\maximus");
3111 RemoveDirectoryA("msitest");
3112 HeapFree(GetProcessHeap(), 0, usersid
);
3115 static void test_publish_product(void)
3117 static const char prodpath
[] =
3118 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3119 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3120 static const char cuprodpath
[] =
3121 "Software\\Microsoft\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3122 static const char cuupgrades
[] =
3123 "Software\\Microsoft\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3124 static const char badprod
[] =
3125 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products"
3126 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3127 static const char machprod
[] =
3128 "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3129 static const char machup
[] =
3130 "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
3134 HKEY sourcelist
, net
, props
;
3135 HKEY hkey
, patches
, media
;
3136 CHAR keypath
[MAX_PATH
];
3137 CHAR temp
[MAX_PATH
];
3138 CHAR path
[MAX_PATH
];
3139 BOOL old_installer
= FALSE
;
3140 REGSAM access
= KEY_ALL_ACCESS
;
3142 if (is_process_limited())
3144 skip("process is limited\n");
3148 if (!(usersid
= get_user_sid()))
3151 GetTempPathA(MAX_PATH
, temp
);
3153 CreateDirectoryA("msitest", NULL
);
3154 create_file("msitest\\maximus", 500);
3156 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3159 access
|= KEY_WOW64_64KEY
;
3161 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3163 /* PublishProduct, current user */
3164 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
3165 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3167 skip("Not enough rights to perform tests\n");
3170 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3171 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3172 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3174 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3175 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3177 sprintf(keypath
, prodpath
, usersid
);
3178 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3179 if (res
== ERROR_FILE_NOT_FOUND
)
3181 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3182 if (res
== ERROR_SUCCESS
)
3184 win_skip("Windows Installer < 3.0 detected\n");
3186 old_installer
= TRUE
;
3191 win_skip("Install failed, no need to continue\n");
3195 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3197 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3198 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3200 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3203 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3204 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3207 delete_key(patches
, "", access
);
3208 RegCloseKey(patches
);
3209 delete_key(hkey
, "", access
);
3213 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuprodpath
, &hkey
);
3214 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3216 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3217 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3218 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3219 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3221 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3222 CHECK_DEL_REG_DWORD(hkey
, "Assignment", 0);
3223 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3224 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3225 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3227 res
= RegOpenKeyA(hkey
, "SourceList", &sourcelist
);
3228 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3230 lstrcpyA(path
, "n;1;");
3231 lstrcatA(path
, temp
);
3232 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3233 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3235 res
= RegOpenKeyA(sourcelist
, "Net", &net
);
3236 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3238 CHECK_DEL_REG_STR(net
, "1", temp
);
3240 RegDeleteKeyA(net
, "");
3243 res
= RegOpenKeyA(sourcelist
, "Media", &media
);
3244 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3246 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3248 RegDeleteKeyA(media
, "");
3250 RegDeleteKeyA(sourcelist
, "");
3251 RegCloseKey(sourcelist
);
3252 RegDeleteKeyA(hkey
, "");
3255 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cuupgrades
, &hkey
);
3256 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3258 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3260 RegDeleteKeyA(hkey
, "");
3263 /* PublishProduct, machine */
3264 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1 ALLUSERS=1");
3267 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3268 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3269 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3271 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, badprod
, 0, access
, &hkey
);
3272 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3274 sprintf(keypath
, prodpath
, "S-1-5-18");
3275 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3276 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3278 res
= RegOpenKeyExA(hkey
, "InstallProperties", 0, access
, &props
);
3279 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3281 res
= RegOpenKeyExA(hkey
, "Patches", 0, access
, &patches
);
3284 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3285 CHECK_DEL_REG_STR(patches
, "AllPatches", NULL
);
3288 delete_key(patches
, "", access
);
3289 RegCloseKey(patches
);
3290 delete_key(hkey
, "", access
);
3294 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machprod
, 0, access
, &hkey
);
3295 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3297 CHECK_DEL_REG_STR(hkey
, "ProductName", "MSITEST");
3298 CHECK_DEL_REG_STR(hkey
, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
3299 CHECK_DEL_REG_DWORD(hkey
, "Language", 1033);
3300 CHECK_DEL_REG_DWORD(hkey
, "Version", 0x1010001);
3302 CHECK_DEL_REG_DWORD(hkey
, "AuthorizedLUAApp", 0);
3303 todo_wine
CHECK_DEL_REG_DWORD(hkey
, "Assignment", 1);
3304 CHECK_DEL_REG_DWORD(hkey
, "AdvertiseFlags", 0x184);
3305 CHECK_DEL_REG_DWORD(hkey
, "InstanceType", 0);
3306 CHECK_DEL_REG_STR(hkey
, "Clients", ":");
3308 res
= RegOpenKeyExA(hkey
, "SourceList", 0, access
, &sourcelist
);
3309 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3311 lstrcpyA(path
, "n;1;");
3312 lstrcatA(path
, temp
);
3313 CHECK_DEL_REG_STR(sourcelist
, "LastUsedSource", path
);
3314 CHECK_DEL_REG_STR(sourcelist
, "PackageName", "msitest.msi");
3316 res
= RegOpenKeyExA(sourcelist
, "Net", 0, access
, &net
);
3317 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3319 CHECK_DEL_REG_STR(net
, "1", temp
);
3321 res
= delete_key(net
, "", access
);
3322 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3325 res
= RegOpenKeyExA(sourcelist
, "Media", 0, access
, &media
);
3326 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3328 CHECK_DEL_REG_STR(media
, "1", "DISK1;");
3330 res
= delete_key(media
, "", access
);
3331 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3333 res
= delete_key(sourcelist
, "", access
);
3334 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3335 RegCloseKey(sourcelist
);
3336 res
= delete_key(hkey
, "", access
);
3337 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3340 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, machup
, 0, access
, &hkey
);
3341 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3343 CHECK_DEL_REG_STR(hkey
, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL
);
3345 res
= delete_key(hkey
, "", access
);
3346 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3350 DeleteFileA(msifile
);
3351 DeleteFileA("msitest\\maximus");
3352 RemoveDirectoryA("msitest");
3353 HeapFree(GetProcessHeap(), 0, usersid
);
3356 static void test_publish_features(void)
3358 static const char cupath
[] =
3359 "Software\\Microsoft\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3360 static const char udfeatpath
[] =
3361 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3362 "\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features";
3363 static const char udpridpath
[] =
3364 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products"
3365 "\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3366 static const char featkey
[] =
3367 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features";
3368 static const char classfeat
[] =
3369 "Software\\Classes\\Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3374 CHAR keypath
[MAX_PATH
];
3375 REGSAM access
= KEY_ALL_ACCESS
;
3377 if (is_process_limited())
3379 skip("process is limited\n");
3383 if (!(usersid
= get_user_sid()))
3386 CreateDirectoryA("msitest", NULL
);
3387 create_file("msitest\\maximus", 500);
3389 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3392 access
|= KEY_WOW64_64KEY
;
3394 MsiSetInternalUI(INSTALLUILEVEL_FULL
, NULL
);
3396 /* PublishFeatures, current user */
3397 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
3398 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3400 skip("Not enough rights to perform tests\n");
3403 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3404 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3405 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3407 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3408 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3410 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3411 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3413 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3414 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3416 CHECK_REG_STR(hkey
, "feature", "");
3417 CHECK_REG_STR(hkey
, "montecristo", "");
3419 RegDeleteValueA(hkey
, "feature");
3420 RegDeleteValueA(hkey
, "montecristo");
3421 delete_key(hkey
, "", access
);
3424 sprintf(keypath
, udfeatpath
, usersid
);
3425 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3426 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3428 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3429 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3431 RegDeleteValueA(hkey
, "feature");
3432 RegDeleteValueA(hkey
, "montecristo");
3433 delete_key(hkey
, "", access
);
3435 sprintf(keypath
, udpridpath
, usersid
);
3436 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3438 /* PublishFeatures, machine */
3439 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1 ALLUSERS=1");
3440 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3441 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3442 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3444 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, featkey
, 0, access
, &hkey
);
3445 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3447 res
= RegOpenKeyA(HKEY_CURRENT_USER
, cupath
, &hkey
);
3448 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3449 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, classfeat
, 0, access
, &hkey
);
3450 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3452 CHECK_REG_STR(hkey
, "feature", "");
3453 CHECK_REG_STR(hkey
, "montecristo", "");
3455 RegDeleteValueA(hkey
, "feature");
3456 RegDeleteValueA(hkey
, "montecristo");
3457 delete_key(hkey
, "", access
);
3460 sprintf(keypath
, udfeatpath
, "S-1-5-18");
3461 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &hkey
);
3462 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3464 CHECK_REG_STR(hkey
, "feature", "VGtfp^p+,?82@JU1j_KE");
3465 CHECK_REG_STR(hkey
, "montecristo", "VGtfp^p+,?82@JU1j_KE");
3467 RegDeleteValueA(hkey
, "feature");
3468 RegDeleteValueA(hkey
, "montecristo");
3469 delete_key(hkey
, "", access
);
3471 sprintf(keypath
, udpridpath
, "S-1-5-18");
3472 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3475 DeleteFileA(msifile
);
3476 DeleteFileA("msitest\\maximus");
3477 RemoveDirectoryA("msitest");
3478 HeapFree(GetProcessHeap(), 0, usersid
);
3481 static LPSTR
reg_get_val_str(HKEY hkey
, LPCSTR name
)
3487 r
= RegQueryValueExA(hkey
, name
, NULL
, NULL
, NULL
, &len
);
3488 if (r
!= ERROR_SUCCESS
)
3491 len
+= sizeof (WCHAR
);
3492 val
= HeapAlloc(GetProcessHeap(), 0, len
);
3493 if (!val
) return NULL
;
3495 RegQueryValueExA(hkey
, name
, NULL
, NULL
, (LPBYTE
)val
, &len
);
3499 static void get_owner_company(LPSTR
*owner
, LPSTR
*company
)
3503 REGSAM access
= KEY_ALL_ACCESS
;
3505 *owner
= *company
= NULL
;
3508 access
|= KEY_WOW64_64KEY
;
3510 res
= RegOpenKeyA(HKEY_CURRENT_USER
,
3511 "Software\\Microsoft\\MS Setup (ACME)\\User Info", &hkey
);
3512 if (res
== ERROR_SUCCESS
)
3514 *owner
= reg_get_val_str(hkey
, "DefName");
3515 *company
= reg_get_val_str(hkey
, "DefCompany");
3519 if (!*owner
|| !*company
)
3521 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3522 "Software\\Microsoft\\Windows\\CurrentVersion", 0, access
, &hkey
);
3523 if (res
== ERROR_SUCCESS
)
3525 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3526 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3531 if (!*owner
|| !*company
)
3533 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
,
3534 "Software\\Microsoft\\Windows NT\\CurrentVersion", 0, access
, &hkey
);
3535 if (res
== ERROR_SUCCESS
)
3537 *owner
= reg_get_val_str(hkey
, "RegisteredOwner");
3538 *company
= reg_get_val_str(hkey
, "RegisteredOrganization");
3544 static void test_register_user(void)
3550 LPSTR owner
, company
;
3551 CHAR keypath
[MAX_PATH
];
3552 REGSAM access
= KEY_ALL_ACCESS
;
3554 static const CHAR keypropsfmt
[] =
3555 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3556 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties";
3557 static const CHAR keypridfmt
[] =
3558 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
3559 "UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
3561 if (is_process_limited())
3563 skip("process is limited\n");
3567 if (!(usersid
= get_user_sid()))
3570 get_owner_company(&owner
, &company
);
3572 CreateDirectoryA("msitest", NULL
);
3573 create_file("msitest\\maximus", 500);
3575 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3578 access
|= KEY_WOW64_64KEY
;
3580 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3582 /* RegisterUser, per-user */
3583 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1");
3584 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3586 skip("Not enough rights to perform tests\n");
3589 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3590 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3591 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3593 sprintf(keypath
, keypropsfmt
, usersid
);
3594 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3595 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3597 CHECK_REG_STR(props
, "ProductID", "none");
3598 CHECK_REG_STR(props
, "RegCompany", company
);
3599 CHECK_REG_STR(props
, "RegOwner", owner
);
3601 RegDeleteValueA(props
, "ProductID");
3602 RegDeleteValueA(props
, "RegCompany");
3603 RegDeleteValueA(props
, "RegOwner");
3604 delete_key(props
, "", access
);
3606 sprintf(keypath
, keypridfmt
, usersid
);
3607 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3609 /* RegisterUser, machine */
3610 r
= MsiInstallProductA(msifile
, "REGISTER_USER=1 ALLUSERS=1");
3611 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3612 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3613 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3615 sprintf(keypath
, keypropsfmt
, "S-1-5-18");
3616 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &props
);
3617 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3619 CHECK_REG_STR(props
, "ProductID", "none");
3620 CHECK_REG_STR(props
, "RegCompany", company
);
3621 CHECK_REG_STR(props
, "RegOwner", owner
);
3623 RegDeleteValueA(props
, "ProductID");
3624 RegDeleteValueA(props
, "RegCompany");
3625 RegDeleteValueA(props
, "RegOwner");
3626 delete_key(props
, "", access
);
3628 sprintf(keypath
, keypridfmt
, "S-1-5-18");
3629 delete_key(HKEY_LOCAL_MACHINE
, keypath
, access
);
3632 HeapFree(GetProcessHeap(), 0, company
);
3633 HeapFree(GetProcessHeap(), 0, owner
);
3635 DeleteFileA(msifile
);
3636 DeleteFileA("msitest\\maximus");
3637 RemoveDirectoryA("msitest");
3641 static void test_process_components(void)
3643 static const char keyfmt
[] =
3644 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
3645 static const char compkey
[] =
3646 "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Components";
3653 CHAR keypath
[MAX_PATH
];
3654 CHAR program_files_maximus
[MAX_PATH
];
3655 REGSAM access
= KEY_ALL_ACCESS
;
3657 if (is_process_limited())
3659 skip("process is limited\n");
3663 if (!(usersid
= get_user_sid()))
3666 CreateDirectoryA("msitest", NULL
);
3667 create_file("msitest\\maximus", 500);
3669 create_database(msifile
, ppc_tables
, sizeof(ppc_tables
) / sizeof(msi_table
));
3672 access
|= KEY_WOW64_64KEY
;
3674 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3676 /* ProcessComponents, per-user */
3677 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
3678 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3680 skip("Not enough rights to perform tests\n");
3683 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3684 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3685 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3687 sprintf(keypath
, keyfmt
, usersid
, "CBABC2FDCCB35E749A8944D8C1C098B5");
3688 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3689 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3692 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3693 NULL
, NULL
, (LPBYTE
)val
, &size
);
3694 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3696 lstrcpyA(program_files_maximus
,PROG_FILES_DIR
);
3697 lstrcatA(program_files_maximus
,"\\msitest\\maximus");
3699 ok(!lstrcmpiA(val
, program_files_maximus
),
3700 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3702 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3703 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3705 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3706 delete_key(comp
, "", access
);
3709 sprintf(keypath
, keyfmt
, usersid
, "241C3DA58FECD0945B9687D408766058");
3710 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3711 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3714 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3715 NULL
, NULL
, (LPBYTE
)val
, &size
);
3716 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3717 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3718 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3720 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3721 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3723 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3724 delete_key(comp
, "", access
);
3727 /* ProcessComponents, machine */
3728 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1 ALLUSERS=1");
3729 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3730 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
3731 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
3733 sprintf(keypath
, keyfmt
, "S-1-5-18", "CBABC2FDCCB35E749A8944D8C1C098B5");
3734 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3735 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3738 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3739 NULL
, NULL
, (LPBYTE
)val
, &size
);
3740 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3741 ok(!lstrcmpiA(val
, program_files_maximus
),
3742 "Expected \"%s\", got \"%s\"\n", program_files_maximus
, val
);
3744 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3745 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3747 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3748 delete_key(comp
, "", access
);
3751 sprintf(keypath
, keyfmt
, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
3752 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, keypath
, 0, access
, &comp
);
3753 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3756 res
= RegQueryValueExA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB",
3757 NULL
, NULL
, (LPBYTE
)val
, &size
);
3758 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3759 ok(!lstrcmpA(val
, "01\\msitest\\augustus"),
3760 "Expected \"01\\msitest\\augustus\", got \"%s\"\n", val
);
3762 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, compkey
, 0, access
, &hkey
);
3763 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3765 RegDeleteValueA(comp
, "84A88FD7F6998CE40A22FB59F6B9C2BB");
3766 delete_key(comp
, "", access
);
3770 DeleteFileA(msifile
);
3771 DeleteFileA("msitest\\maximus");
3772 RemoveDirectoryA("msitest");
3776 static void test_publish(void)
3778 static const char subkey
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3779 static const char subkey_32node
[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
3782 HKEY uninstall
, prodkey
, uninstall_32node
= NULL
;
3784 char date
[MAX_PATH
], temp
[MAX_PATH
], prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
3785 REGSAM access
= KEY_ALL_ACCESS
;
3788 if (!pMsiQueryFeatureStateExA
)
3790 win_skip("MsiQueryFeatureStateExA is not available\n");
3793 if (is_process_limited())
3795 skip("process is limited\n");
3800 GetTempPathA(MAX_PATH
, temp
);
3803 access
|= KEY_WOW64_64KEY
;
3805 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey
, 0, KEY_ALL_ACCESS
, &uninstall
);
3806 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3810 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, subkey_32node
, 0, KEY_ALL_ACCESS
, &uninstall_32node
);
3811 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3814 CreateDirectoryA("msitest", NULL
);
3815 create_file("msitest\\maximus", 500);
3817 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
3819 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
3821 state
= MsiQueryProductStateA(prodcode
);
3822 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3824 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3825 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3828 SetLastError(0xdeadbeef);
3829 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3830 error
= GetLastError();
3831 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3832 ok(state
== 0xdead, "got %d\n", state
);
3833 ok(error
== 0xdeadbeef, "got %u\n", error
);
3836 SetLastError(0xdeadbeef);
3837 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
3838 error
= GetLastError();
3839 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3840 ok(state
== 0xdead, "got %d\n", state
);
3841 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3844 SetLastError(0xdeadbeef);
3845 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
3846 error
= GetLastError();
3847 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3848 ok(state
== 0xdead, "got %d\n", state
);
3849 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
3851 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3852 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3854 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3855 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3857 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3858 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3859 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3860 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3862 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3863 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3865 /* nothing published */
3866 r
= MsiInstallProductA(msifile
, NULL
);
3867 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
3869 skip("Not enough rights to perform tests\n");
3872 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
3873 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3874 ok(pf_exists("msitest"), "File not installed\n");
3876 state
= MsiQueryProductStateA(prodcode
);
3877 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3879 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3880 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3882 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3883 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3885 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3886 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3887 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3888 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3890 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3891 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3893 /* PublishProduct and RegisterProduct */
3894 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1");
3895 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3896 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3897 ok(pf_exists("msitest"), "File not installed\n");
3899 state
= MsiQueryProductStateA(prodcode
);
3900 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3902 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3903 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3905 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3906 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3908 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3909 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3910 ok(r
== ERROR_UNKNOWN_COMPONENT
, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r
);
3911 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3915 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3916 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3920 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3921 if (is_wow64
&& res
== ERROR_FILE_NOT_FOUND
) /* XP - Vista, Wow64 */
3922 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
3923 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
3926 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
3927 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
3928 CHECK_REG_STR(prodkey
, "InstallDate", date
);
3929 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
3930 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3931 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
3932 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
3933 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
3934 CHECK_REG_STR(prodkey
, "Comments", NULL
);
3935 CHECK_REG_STR(prodkey
, "Contact", NULL
);
3936 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
3937 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
3938 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
3939 CHECK_REG_STR(prodkey
, "Readme", NULL
);
3940 CHECK_REG_STR(prodkey
, "Size", NULL
);
3941 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
3942 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
3943 CHECK_REG_DWORD(prodkey
, "Language", 1033);
3944 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
3945 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
3946 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
3947 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
3950 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
3953 RegCloseKey(prodkey
);
3955 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
3956 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3957 ok(pf_exists("msitest\\maximus"), "File deleted\n");
3958 ok(pf_exists("msitest"), "File deleted\n");
3960 state
= MsiQueryProductStateA(prodcode
);
3961 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3963 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3964 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3966 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
3967 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3969 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
3970 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
3971 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
3972 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
3974 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
3975 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
3977 /* complete install */
3978 r
= MsiInstallProductA(msifile
, "FULL=1");
3979 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
3980 ok(pf_exists("msitest\\maximus"), "File not installed\n");
3981 ok(pf_exists("msitest"), "File not installed\n");
3983 state
= MsiQueryProductStateA(prodcode
);
3984 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
3986 state
= MsiQueryFeatureStateA(prodcode
, "feature");
3987 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
3990 SetLastError(0xdeadbeef);
3991 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_MACHINE
, "feature", &state
);
3992 error
= GetLastError();
3993 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
3994 ok(state
== 0xdead, "got %d\n", state
);
3995 ok(error
== 0xdeadbeef, "got %u\n", error
);
3998 SetLastError(0xdeadbeef);
3999 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERMANAGED
, "feature", &state
);
4000 error
= GetLastError();
4001 ok(r
== ERROR_UNKNOWN_PRODUCT
, "got %u\n", r
);
4002 ok(state
== 0xdead, "got %d\n", state
);
4003 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4006 SetLastError(0xdeadbeef);
4007 r
= pMsiQueryFeatureStateExA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
, "feature", &state
);
4008 error
= GetLastError();
4009 ok(r
== ERROR_SUCCESS
, "got %u\n", r
);
4010 ok(state
== INSTALLSTATE_LOCAL
, "got %d\n", state
);
4011 ok(error
== ERROR_SUCCESS
, "got %u\n", error
);
4013 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4014 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4016 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4017 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4018 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4019 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4023 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4024 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4028 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4029 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4032 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4033 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4034 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4035 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4036 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4037 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4038 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4039 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4040 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4041 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4042 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4043 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4044 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4045 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4046 CHECK_REG_STR(prodkey
, "Size", NULL
);
4047 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4048 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4049 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4050 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4051 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4052 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4053 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4056 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4059 RegCloseKey(prodkey
);
4061 /* no UnpublishFeatures */
4062 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4063 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4064 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4065 ok(!pf_exists("msitest"), "Directory not deleted\n");
4067 state
= MsiQueryProductStateA(prodcode
);
4068 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4070 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4071 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4073 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4074 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4076 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4077 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4078 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4079 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4081 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4082 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4084 /* complete install */
4085 r
= MsiInstallProductA(msifile
, "FULL=1");
4086 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4087 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4088 ok(pf_exists("msitest"), "File not installed\n");
4090 state
= MsiQueryProductStateA(prodcode
);
4091 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4093 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4094 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4096 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4097 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4099 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4100 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4101 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4102 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4106 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4107 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4111 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4112 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4115 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4116 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4117 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4118 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4119 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4120 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4121 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4122 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4123 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4124 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4125 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4126 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4127 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4128 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4129 CHECK_REG_STR(prodkey
, "Size", NULL
);
4130 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4131 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4132 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4133 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4134 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4135 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4136 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4139 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4142 RegCloseKey(prodkey
);
4144 /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
4145 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature");
4146 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4147 ok(pf_exists("msitest\\maximus"), "File deleted\n");
4148 ok(pf_exists("msitest"), "Directory deleted\n");
4150 state
= MsiQueryProductStateA(prodcode
);
4151 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4153 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4154 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4156 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4157 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4159 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4160 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4161 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4162 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4166 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4167 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4171 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4172 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4175 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4176 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4177 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4178 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4179 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4180 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4181 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4182 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4183 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4184 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4185 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4186 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4187 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4188 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4189 CHECK_REG_STR(prodkey
, "Size", NULL
);
4190 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4191 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4192 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4193 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4194 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4195 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4196 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4199 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4202 RegCloseKey(prodkey
);
4204 /* complete install */
4205 r
= MsiInstallProductA(msifile
, "FULL=1");
4206 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4207 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4208 ok(pf_exists("msitest"), "File not installed\n");
4210 state
= MsiQueryProductStateA(prodcode
);
4211 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4213 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4214 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4216 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4217 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4219 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4220 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4221 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4222 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4226 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4227 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4231 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4232 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4235 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4236 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4237 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4238 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4239 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4240 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4241 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4242 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4243 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4244 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4245 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4246 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4247 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4248 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4249 CHECK_REG_STR(prodkey
, "Size", NULL
);
4250 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4251 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4252 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4253 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4254 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4255 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4256 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4259 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -20, 10, 24);
4262 RegCloseKey(prodkey
);
4264 /* UnpublishFeatures, both features removed */
4265 r
= MsiInstallProductA(msifile
, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
4266 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4267 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4268 ok(!pf_exists("msitest"), "Directory not deleted\n");
4270 state
= MsiQueryProductStateA(prodcode
);
4271 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4273 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4274 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4276 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4277 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4279 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4280 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4281 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4282 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4284 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4285 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4287 /* complete install */
4288 r
= MsiInstallProductA(msifile
, "FULL=1");
4289 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4290 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4291 ok(pf_exists("msitest"), "File not installed\n");
4293 state
= MsiQueryProductStateA(prodcode
);
4294 ok(state
== INSTALLSTATE_DEFAULT
, "Expected INSTALLSTATE_DEFAULT, got %d\n", state
);
4296 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4297 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4299 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4300 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4302 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4303 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4304 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4305 ok(state
== INSTALLSTATE_LOCAL
, "Expected INSTALLSTATE_LOCAL, got %d\n", state
);
4309 res
= RegOpenKeyExA(uninstall_32node
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4310 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4314 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, KEY_ALL_ACCESS
, &prodkey
);
4315 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4318 CHECK_REG_STR(prodkey
, "DisplayName", "MSITEST");
4319 CHECK_REG_STR(prodkey
, "DisplayVersion", "1.1.1");
4320 CHECK_REG_STR(prodkey
, "InstallDate", date
);
4321 CHECK_REG_STR(prodkey
, "InstallSource", temp
);
4322 CHECK_REG_ISTR(prodkey
, "ModifyPath", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4323 CHECK_REG_STR(prodkey
, "Publisher", "Wine");
4324 CHECK_REG_STR(prodkey
, "UninstallString", "MsiExec.exe /I{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
4325 CHECK_REG_STR(prodkey
, "AuthorizedCDFPrefix", NULL
);
4326 CHECK_REG_STR(prodkey
, "Comments", NULL
);
4327 CHECK_REG_STR(prodkey
, "Contact", NULL
);
4328 CHECK_REG_STR(prodkey
, "HelpLink", NULL
);
4329 CHECK_REG_STR(prodkey
, "HelpTelephone", NULL
);
4330 CHECK_REG_STR(prodkey
, "InstallLocation", NULL
);
4331 CHECK_REG_STR(prodkey
, "Readme", NULL
);
4332 CHECK_REG_STR(prodkey
, "Size", NULL
);
4333 CHECK_REG_STR(prodkey
, "URLInfoAbout", NULL
);
4334 CHECK_REG_STR(prodkey
, "URLUpdateInfo", NULL
);
4335 CHECK_REG_DWORD(prodkey
, "Language", 1033);
4336 CHECK_REG_DWORD(prodkey
, "Version", 0x1010001);
4337 CHECK_REG_DWORD(prodkey
, "VersionMajor", 1);
4338 CHECK_REG_DWORD(prodkey
, "VersionMinor", 1);
4339 CHECK_REG_DWORD(prodkey
, "WindowsInstaller", 1);
4342 CHECK_REG_DWORD4(prodkey
, "EstimatedSize", 12, -12, 10, 24);
4345 RegCloseKey(prodkey
);
4347 /* complete uninstall */
4348 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4349 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4350 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4351 ok(!pf_exists("msitest"), "Directory not deleted\n");
4353 state
= MsiQueryProductStateA(prodcode
);
4354 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4356 state
= MsiQueryFeatureStateA(prodcode
, "feature");
4357 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4359 state
= MsiQueryFeatureStateA(prodcode
, "montecristo");
4360 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4362 r
= pMsiQueryComponentStateA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4363 "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state
);
4364 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4365 ok(state
== INSTALLSTATE_UNKNOWN
, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state
);
4367 res
= RegOpenKeyExA(uninstall
, prodcode
, 0, access
, &prodkey
);
4368 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4370 /* make sure 'Program Files\msitest' is removed */
4371 delete_pfmsitest_files();
4374 RegCloseKey(uninstall
);
4375 RegCloseKey(uninstall_32node
);
4376 DeleteFileA(msifile
);
4377 DeleteFileA("msitest\\maximus");
4378 RemoveDirectoryA("msitest");
4381 static void test_publish_sourcelist(void)
4385 CHAR value
[MAX_PATH
];
4386 CHAR path
[MAX_PATH
];
4387 CHAR prodcode
[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
4389 if (!pMsiSourceListEnumSourcesA
|| !pMsiSourceListGetInfoA
)
4391 win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
4394 if (is_process_limited())
4396 skip("process is limited\n");
4400 CreateDirectoryA("msitest", NULL
);
4401 create_file("msitest\\maximus", 500);
4403 create_database(msifile
, pp_tables
, sizeof(pp_tables
) / sizeof(msi_table
));
4405 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4407 r
= MsiInstallProductA(msifile
, NULL
);
4408 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4410 skip("Not enough rights to perform tests\n");
4413 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4414 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4415 ok(pf_exists("msitest"), "File not installed\n");
4417 /* nothing published */
4419 lstrcpyA(value
, "aaa");
4420 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4421 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4422 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4423 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4424 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4427 lstrcpyA(value
, "aaa");
4428 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4429 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4430 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4431 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4432 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4434 r
= MsiInstallProductA(msifile
, "REGISTER_PRODUCT=1");
4435 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4436 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4437 ok(pf_exists("msitest"), "File not installed\n");
4439 /* after RegisterProduct */
4441 lstrcpyA(value
, "aaa");
4442 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4443 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4444 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4445 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4446 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4449 lstrcpyA(value
, "aaa");
4450 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4451 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4452 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4453 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4454 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4456 r
= MsiInstallProductA(msifile
, "PROCESS_COMPONENTS=1");
4457 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4458 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4459 ok(pf_exists("msitest"), "File not installed\n");
4461 /* after ProcessComponents */
4463 lstrcpyA(value
, "aaa");
4464 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4465 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4466 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4467 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4468 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4471 lstrcpyA(value
, "aaa");
4472 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4473 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4474 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4475 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4476 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4478 r
= MsiInstallProductA(msifile
, "PUBLISH_FEATURES=1");
4479 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4480 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4481 ok(pf_exists("msitest"), "File not installed\n");
4483 /* after PublishFeatures */
4485 lstrcpyA(value
, "aaa");
4486 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4487 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4488 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4489 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4490 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4493 lstrcpyA(value
, "aaa");
4494 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4495 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4496 ok(r
== ERROR_UNKNOWN_PRODUCT
, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r
);
4497 ok(size
== MAX_PATH
, "Expected %d, got %d\n", MAX_PATH
, size
);
4498 ok(!lstrcmpA(value
, "aaa"), "Expected \"aaa\", got \"%s\"\n", value
);
4500 r
= MsiInstallProductA(msifile
, "PUBLISH_PRODUCT=1");
4501 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4502 ok(pf_exists("msitest\\maximus"), "File not installed\n");
4503 ok(pf_exists("msitest"), "File not installed\n");
4505 /* after PublishProduct */
4507 lstrcpyA(value
, "aaa");
4508 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4509 MSICODE_PRODUCT
, INSTALLPROPERTY_PACKAGENAMEA
, value
, &size
);
4510 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4511 ok(!lstrcmpA(value
, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value
);
4512 ok(size
== 11, "Expected 11, got %d\n", size
);
4515 lstrcpyA(value
, "aaa");
4516 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4517 MSICODE_PRODUCT
, INSTALLPROPERTY_MEDIAPACKAGEPATHA
, value
, &size
);
4518 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4519 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4520 ok(size
== 0, "Expected 0, got %d\n", size
);
4523 lstrcpyA(value
, "aaa");
4524 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4525 MSICODE_PRODUCT
, INSTALLPROPERTY_DISKPROMPTA
, value
, &size
);
4526 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4527 ok(!lstrcmpA(value
, ""), "Expected \"\", got \"%s\"\n", value
);
4528 ok(size
== 0, "Expected 0, got %d\n", size
);
4530 lstrcpyA(path
, CURR_DIR
);
4531 lstrcatA(path
, "\\");
4534 lstrcpyA(value
, "aaa");
4535 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4536 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDSOURCEA
, value
, &size
);
4537 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4538 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4539 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4542 lstrcpyA(value
, "aaa");
4543 r
= pMsiSourceListGetInfoA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4544 MSICODE_PRODUCT
, INSTALLPROPERTY_LASTUSEDTYPEA
, value
, &size
);
4545 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4546 ok(!lstrcmpA(value
, "n"), "Expected \"n\", got \"%s\"\n", value
);
4547 ok(size
== 1, "Expected 1, got %d\n", size
);
4550 lstrcpyA(value
, "aaa");
4551 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4552 MSICODE_PRODUCT
| MSISOURCETYPE_URL
, 0, value
, &size
);
4553 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4554 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4555 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4558 lstrcpyA(value
, "aaa");
4559 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4560 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 0, value
, &size
);
4561 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4562 ok(!lstrcmpA(value
, path
), "Expected \"%s\", got \"%s\"\n", path
, value
);
4563 ok(size
== lstrlenA(path
), "Expected %d, got %d\n", lstrlenA(path
), size
);
4566 lstrcpyA(value
, "aaa");
4567 r
= pMsiSourceListEnumSourcesA(prodcode
, NULL
, MSIINSTALLCONTEXT_USERUNMANAGED
,
4568 MSICODE_PRODUCT
| MSISOURCETYPE_NETWORK
, 1, value
, &size
);
4569 ok(r
== ERROR_NO_MORE_ITEMS
, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r
);
4570 ok(!lstrcmpA(value
, "aaa"), "Expected value to be unchanged, got %s\n", value
);
4571 ok(size
== MAX_PATH
, "Expected MAX_PATH, got %d\n", size
);
4573 /* complete uninstall */
4574 r
= MsiInstallProductA(msifile
, "FULL=1 REMOVE=ALL");
4575 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", r
);
4576 ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
4577 ok(!pf_exists("msitest"), "Directory not deleted\n");
4579 /* make sure 'Program Files\msitest' is removed */
4580 delete_pfmsitest_files();
4583 DeleteFileA(msifile
);
4584 DeleteFileA("msitest\\maximus");
4585 RemoveDirectoryA("msitest");
4588 static void create_pf_data(LPCSTR file
, LPCSTR data
, BOOL is_file
)
4590 CHAR path
[MAX_PATH
];
4592 lstrcpyA(path
, PROG_FILES_DIR
);
4593 lstrcatA(path
, "\\");
4594 lstrcatA(path
, file
);
4597 create_file_data(path
, data
, 500);
4599 CreateDirectoryA(path
, NULL
);
4602 #define create_pf(file, is_file) create_pf_data(file, file, is_file)
4604 static void test_remove_files(void)
4608 if (is_process_limited())
4610 skip("process is limited\n");
4614 CreateDirectoryA("msitest", NULL
);
4615 create_file("msitest\\hydrogen", 500);
4616 create_file("msitest\\helium", 500);
4617 create_file("msitest\\lithium", 500);
4619 create_database(msifile
, rem_tables
, sizeof(rem_tables
) / sizeof(msi_table
));
4621 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4623 r
= MsiInstallProductA(msifile
, NULL
);
4624 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4626 skip("Not enough rights to perform tests\n");
4629 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4630 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4631 ok(!pf_exists("msitest\\helium"), "File installed\n");
4632 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4633 ok(pf_exists("msitest"), "File not installed\n");
4635 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4636 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4637 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4638 ok(!pf_exists("msitest\\helium"), "File not deleted\n");
4639 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4640 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4642 create_pf("msitest", FALSE
);
4643 create_pf("msitest\\hydrogen", TRUE
);
4644 create_pf("msitest\\helium", TRUE
);
4645 create_pf("msitest\\lithium", TRUE
);
4647 r
= MsiInstallProductA(msifile
, NULL
);
4648 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4649 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4650 ok(pf_exists("msitest\\helium"), "File not installed\n");
4651 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4652 ok(pf_exists("msitest"), "File not installed\n");
4654 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4655 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4656 ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
4657 ok(delete_pf("msitest\\helium", TRUE
), "File deleted\n");
4658 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4659 ok(delete_pf("msitest", FALSE
), "Directory deleted\n");
4661 create_pf("msitest", FALSE
);
4662 create_pf("msitest\\furlong", TRUE
);
4663 create_pf("msitest\\firkin", TRUE
);
4664 create_pf("msitest\\fortnight", TRUE
);
4665 create_pf("msitest\\becquerel", TRUE
);
4666 create_pf("msitest\\dioptre", TRUE
);
4667 create_pf("msitest\\attoparsec", TRUE
);
4668 create_pf("msitest\\storeys", TRUE
);
4669 create_pf("msitest\\block", TRUE
);
4670 create_pf("msitest\\siriometer", TRUE
);
4671 create_pf("msitest\\cabout", FALSE
);
4672 create_pf("msitest\\cabout\\blocker", TRUE
);
4674 r
= MsiInstallProductA(msifile
, NULL
);
4675 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4676 ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
4677 ok(!pf_exists("msitest\\helium"), "File installed\n");
4678 ok(pf_exists("msitest\\lithium"), "File not installed\n");
4679 ok(!pf_exists("msitest\\furlong"), "File not deleted\n");
4680 ok(!pf_exists("msitest\\firkin"), "File not deleted\n");
4681 ok(!pf_exists("msitest\\fortnight"), "File not deleted\n");
4682 ok(pf_exists("msitest\\becquerel"), "File not installed\n");
4683 ok(pf_exists("msitest\\dioptre"), "File not installed\n");
4684 ok(pf_exists("msitest\\attoparsec"), "File not installed\n");
4685 ok(!pf_exists("msitest\\storeys"), "File not deleted\n");
4686 ok(!pf_exists("msitest\\block"), "File not deleted\n");
4687 ok(!pf_exists("msitest\\siriometer"), "File not deleted\n");
4688 ok(pf_exists("msitest\\cabout"), "Directory removed\n");
4689 ok(pf_exists("msitest"), "File not installed\n");
4691 create_pf("msitest\\furlong", TRUE
);
4692 create_pf("msitest\\firkin", TRUE
);
4693 create_pf("msitest\\fortnight", TRUE
);
4694 create_pf("msitest\\storeys", TRUE
);
4695 create_pf("msitest\\block", TRUE
);
4696 create_pf("msitest\\siriometer", TRUE
);
4698 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4700 ok(!delete_pf("msitest\\hydrogen", TRUE
), "File not deleted\n");
4701 ok(!delete_pf("msitest\\helium", TRUE
), "File not deleted\n");
4702 ok(delete_pf("msitest\\lithium", TRUE
), "File deleted\n");
4703 ok(delete_pf("msitest\\furlong", TRUE
), "File deleted\n");
4704 ok(delete_pf("msitest\\firkin", TRUE
), "File deleted\n");
4705 ok(delete_pf("msitest\\fortnight", TRUE
), "File deleted\n");
4706 ok(!delete_pf("msitest\\becquerel", TRUE
), "File not deleted\n");
4707 ok(!delete_pf("msitest\\dioptre", TRUE
), "File not deleted\n");
4708 ok(delete_pf("msitest\\attoparsec", TRUE
), "File deleted\n");
4709 ok(!delete_pf("msitest\\storeys", TRUE
), "File not deleted\n");
4710 ok(!delete_pf("msitest\\block", TRUE
), "File not deleted\n");
4711 ok(delete_pf("msitest\\siriometer", TRUE
), "File deleted\n");
4712 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4713 ok(pf_exists("msitest"), "Directory deleted\n");
4715 r
= MsiInstallProductA(msifile
, NULL
);
4716 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4717 ok(delete_pf("msitest\\hydrogen", TRUE
), "File not installed\n");
4718 ok(!delete_pf("msitest\\helium", TRUE
), "File installed\n");
4719 ok(delete_pf("msitest\\lithium", TRUE
), "File not installed\n");
4720 ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
4721 ok(pf_exists("msitest"), "Directory deleted\n");
4723 delete_pf("msitest\\cabout\\blocker", TRUE
);
4725 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
4726 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4727 ok(!delete_pf("msitest\\cabout", FALSE
), "Directory not deleted\n");
4728 delete_pf("msitest", FALSE
);
4731 DeleteFileA(msifile
);
4732 DeleteFileA("msitest\\hydrogen");
4733 DeleteFileA("msitest\\helium");
4734 DeleteFileA("msitest\\lithium");
4735 RemoveDirectoryA("msitest");
4738 static void test_move_files(void)
4741 char props
[MAX_PATH
];
4743 if (is_process_limited())
4745 skip("process is limited\n");
4749 CreateDirectoryA("msitest", NULL
);
4750 create_file("msitest\\augustus", 100);
4751 create_file("cameroon", 100);
4752 create_file("djibouti", 100);
4753 create_file("egypt", 100);
4754 create_file("finland", 100);
4755 create_file("gambai", 100);
4756 create_file("honduras", 100);
4757 create_file("msitest\\india", 100);
4758 create_file("japan", 100);
4759 create_file("kenya", 100);
4760 CreateDirectoryA("latvia", NULL
);
4761 create_file("nauru", 100);
4762 create_file("peru", 100);
4763 create_file("apple", 100);
4764 create_file("application", 100);
4765 create_file("ape", 100);
4766 create_file("foo", 100);
4767 create_file("fao", 100);
4768 create_file("fbod", 100);
4769 create_file("budding", 100);
4770 create_file("buddy", 100);
4771 create_file("bud", 100);
4772 create_file("bar", 100);
4773 create_file("bur", 100);
4774 create_file("bird", 100);
4776 create_database(msifile
, mov_tables
, sizeof(mov_tables
) / sizeof(msi_table
));
4778 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4780 /* if the source or dest property is not a full path,
4781 * windows tries to access it as a network resource
4784 sprintf(props
, "SOURCEFULL=\"%s\\\" DESTFULL=\"%s\\msitest\" "
4785 "FILEPATHBAD=\"%s\\japan\" FILEPATHGOOD=\"%s\\kenya\"",
4786 CURR_DIR
, PROG_FILES_DIR
, CURR_DIR
, CURR_DIR
);
4788 r
= MsiInstallProductA(msifile
, props
);
4789 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4791 skip("Not enough rights to perform tests\n");
4794 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4795 ok(delete_pf("msitest\\augustus", TRUE
), "File not installed\n");
4796 ok(!delete_pf("msitest\\dest", TRUE
), "File copied\n");
4797 ok(delete_pf("msitest\\canada", TRUE
), "File not copied\n");
4798 ok(delete_pf("msitest\\dominica", TRUE
), "File not moved\n");
4799 ok(!delete_pf("msitest\\elsalvador", TRUE
), "File moved\n");
4800 ok(!delete_pf("msitest\\france", TRUE
), "File moved\n");
4801 ok(!delete_pf("msitest\\georgia", TRUE
), "File moved\n");
4802 ok(delete_pf("msitest\\hungary", TRUE
), "File not moved\n");
4803 ok(!delete_pf("msitest\\indonesia", TRUE
), "File moved\n");
4804 ok(!delete_pf("msitest\\jordan", TRUE
), "File moved\n");
4805 ok(delete_pf("msitest\\kiribati", TRUE
), "File not moved\n");
4806 ok(!delete_pf("msitest\\lebanon", TRUE
), "File moved\n");
4807 ok(!delete_pf("msitest\\lebanon", FALSE
), "Directory moved\n");
4808 ok(delete_pf("msitest\\poland", TRUE
), "File not moved\n");
4809 /* either apple or application will be moved depending on directory order */
4810 if (!delete_pf("msitest\\apple", TRUE
))
4811 ok(delete_pf("msitest\\application", TRUE
), "File not moved\n");
4813 ok(!delete_pf("msitest\\application", TRUE
), "File should not exist\n");
4814 ok(delete_pf("msitest\\wildcard", TRUE
), "File not moved\n");
4815 ok(!delete_pf("msitest\\ape", TRUE
), "File moved\n");
4816 /* either fao or foo will be moved depending on directory order */
4817 if (delete_pf("msitest\\foo", TRUE
))
4818 ok(!delete_pf("msitest\\fao", TRUE
), "File should not exist\n");
4820 ok(delete_pf("msitest\\fao", TRUE
), "File not moved\n");
4821 ok(delete_pf("msitest\\single", TRUE
), "File not moved\n");
4822 ok(!delete_pf("msitest\\fbod", TRUE
), "File moved\n");
4823 ok(delete_pf("msitest\\budding", TRUE
), "File not moved\n");
4824 ok(delete_pf("msitest\\buddy", TRUE
), "File not moved\n");
4825 ok(!delete_pf("msitest\\bud", TRUE
), "File moved\n");
4826 ok(delete_pf("msitest\\bar", TRUE
), "File not moved\n");
4827 ok(delete_pf("msitest\\bur", TRUE
), "File not moved\n");
4828 ok(!delete_pf("msitest\\bird", TRUE
), "File moved\n");
4829 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4830 ok(DeleteFileA("cameroon"), "File moved\n");
4831 ok(!DeleteFileA("djibouti"), "File not moved\n");
4832 ok(DeleteFileA("egypt"), "File moved\n");
4833 ok(DeleteFileA("finland"), "File moved\n");
4834 ok(DeleteFileA("gambai"), "File moved\n");
4835 ok(!DeleteFileA("honduras"), "File not moved\n");
4836 ok(DeleteFileA("msitest\\india"), "File moved\n");
4837 ok(DeleteFileA("japan"), "File moved\n");
4838 ok(!DeleteFileA("kenya"), "File not moved\n");
4839 ok(RemoveDirectoryA("latvia"), "Directory moved\n");
4840 ok(!DeleteFileA("nauru"), "File not moved\n");
4841 ok(!DeleteFileA("peru"), "File not moved\n");
4842 ok(!DeleteFileA("apple"), "File not moved\n");
4843 ok(!DeleteFileA("application"), "File not moved\n");
4844 ok(DeleteFileA("ape"), "File moved\n");
4845 ok(!DeleteFileA("foo"), "File not moved\n");
4846 ok(!DeleteFileA("fao"), "File not moved\n");
4847 ok(DeleteFileA("fbod"), "File moved\n");
4848 ok(!DeleteFileA("budding"), "File not moved\n");
4849 ok(!DeleteFileA("buddy"), "File not moved\n");
4850 ok(DeleteFileA("bud"), "File moved\n");
4851 ok(!DeleteFileA("bar"), "File not moved\n");
4852 ok(!DeleteFileA("bur"), "File not moved\n");
4853 ok(DeleteFileA("bird"), "File moved\n");
4856 DeleteFileA("cameroon");
4857 DeleteFileA("djibouti");
4858 DeleteFileA("egypt");
4859 DeleteFileA("finland");
4860 DeleteFileA("gambai");
4861 DeleteFileA("honduras");
4862 DeleteFileA("japan");
4863 DeleteFileA("kenya");
4864 DeleteFileA("nauru");
4865 DeleteFileA("peru");
4866 DeleteFileA("apple");
4867 DeleteFileA("application");
4871 DeleteFileA("fbod");
4872 DeleteFileA("budding");
4873 DeleteFileA("buddy");
4877 DeleteFileA("bird");
4878 DeleteFileA("msitest\\india");
4879 DeleteFileA("msitest\\augustus");
4880 RemoveDirectoryA("latvia");
4881 RemoveDirectoryA("msitest");
4882 DeleteFileA(msifile
);
4885 static void test_duplicate_files(void)
4889 if (is_process_limited())
4891 skip("process is limited\n");
4895 CreateDirectoryA("msitest", NULL
);
4896 create_file("msitest\\maximus", 500);
4897 create_database(msifile
, df_tables
, sizeof(df_tables
) / sizeof(msi_table
));
4899 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4901 /* fails if the destination folder is not a valid property */
4903 r
= MsiInstallProductA(msifile
, NULL
);
4904 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4906 skip("Not enough rights to perform tests\n");
4909 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4910 ok(delete_pf("msitest\\maximus", TRUE
), "File not installed\n");
4911 ok(delete_pf("msitest\\augustus", TRUE
), "File not duplicated\n");
4912 ok(delete_pf("msitest\\this\\doesnot\\exist\\maximus", TRUE
), "File not duplicated\n");
4913 ok(delete_pf("msitest\\this\\doesnot\\exist", FALSE
), "Directory not created\n");
4914 ok(delete_pf("msitest\\this\\doesnot", FALSE
), "Directory not created\n");
4915 ok(delete_pf("msitest\\this", FALSE
), "Directory not created\n");
4916 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4919 DeleteFileA("msitest\\maximus");
4920 RemoveDirectoryA("msitest");
4921 DeleteFileA(msifile
);
4924 static void test_write_registry_values(void)
4930 CHAR path
[MAX_PATH
];
4933 if (is_process_limited())
4935 skip("process is limited\n");
4939 CreateDirectoryA("msitest", NULL
);
4940 create_file("msitest\\augustus", 500);
4942 create_database(msifile
, wrv_tables
, sizeof(wrv_tables
) / sizeof(msi_table
));
4944 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
4947 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL
, 0,
4948 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
4950 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, NULL
, 0, KEY_ALL_ACCESS
,
4952 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4954 res
= RegSetValueExA(hkey
, "Value1", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4955 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4956 res
= RegSetValueExA(hkey
, "Value2", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4957 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4958 res
= RegSetValueExA(hkey
, "Value3", 0, REG_MULTI_SZ
, (const BYTE
*)"two\0", 5);
4959 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4960 res
= RegSetValueExA(hkey
, "Value4", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4961 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4962 res
= RegSetValueExA(hkey
, "Value5", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0two\0", 9);
4963 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4964 res
= RegSetValueExA(hkey
, "Value6", 0, REG_MULTI_SZ
, (const BYTE
*)"one\0", 5);
4965 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4966 res
= RegSetValueExA(hkey
, "Value7", 0, REG_SZ
, (const BYTE
*)"one", 4);
4967 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4970 r
= MsiInstallProductA(msifile
, NULL
);
4971 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
4973 skip("Not enough rights to perform tests\n");
4976 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
4977 ok(delete_pf("msitest\\augustus", TRUE
), "File installed\n");
4978 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
4981 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4983 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS
, &hkey
);
4984 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4988 memset(path
, 'a', MAX_PATH
);
4989 res
= RegQueryValueExA(hkey
, "Value", NULL
, &type
, (LPBYTE
)path
, &size
);
4990 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
4991 ok(!memcmp(path
, "one\0two\0three\0\0", size
), "Wrong multi-sz data\n");
4992 ok(size
== 15, "Expected 15, got %d\n", size
);
4993 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
4995 res
= RegQueryValueExA(hkey
, "", NULL
, NULL
, NULL
, NULL
);
4996 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
4998 res
= action_RegDeleteTreeA(hkey
, "VisualStudio", KEY_ALL_ACCESS
);
4999 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5003 memset(path
, 'a', MAX_PATH
);
5004 res
= RegQueryValueExA(hkey
, "Value1", NULL
, &type
, (LPBYTE
)path
, &size
);
5005 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5006 ok(!memcmp(path
, "one\0", size
), "Wrong multi-sz data\n");
5007 ok(size
== 5, "Expected 5, got %d\n", size
);
5008 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5012 memset(path
, 'a', MAX_PATH
);
5013 res
= RegQueryValueExA(hkey
, "Value2", NULL
, &type
, (LPBYTE
)path
, &size
);
5014 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5015 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5016 ok(size
== 9, "Expected 9, got %d\n", size
);
5017 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5021 memset(path
, 'a', MAX_PATH
);
5022 res
= RegQueryValueExA(hkey
, "Value3", NULL
, &type
, (LPBYTE
)path
, &size
);
5023 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5024 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5025 ok(size
== 9, "Expected 9, got %d\n", size
);
5026 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5030 memset(path
, 'a', MAX_PATH
);
5031 res
= RegQueryValueExA(hkey
, "Value4", NULL
, &type
, (LPBYTE
)path
, &size
);
5032 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5033 ok(!memcmp(path
, "one\0two\0", size
), "Wrong multi-sz data\n");
5034 ok(size
== 9, "Expected 9, got %d\n", size
);
5035 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5039 memset(path
, 'a', MAX_PATH
);
5040 res
= RegQueryValueExA(hkey
, "Value5", NULL
, &type
, (LPBYTE
)path
, &size
);
5041 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5042 ok(!memcmp(path
, "one\0two\0three\0", size
), "Wrong multi-sz data\n");
5043 ok(size
== 15, "Expected 15, got %d\n", size
);
5044 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5048 memset(path
, 'a', MAX_PATH
);
5049 res
= RegQueryValueExA(hkey
, "Value6", NULL
, &type
, (LPBYTE
)path
, &size
);
5050 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5051 ok(!memcmp(path
, "", size
), "Wrong multi-sz data\n");
5052 ok(size
== 1, "Expected 1, got %d\n", size
);
5053 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5057 memset(path
, 'a', MAX_PATH
);
5058 res
= RegQueryValueExA(hkey
, "Value7", NULL
, &type
, (LPBYTE
)path
, &size
);
5059 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5060 ok(!memcmp(path
, "two\0", size
), "Wrong multi-sz data\n");
5061 ok(size
== 5, "Expected 5, got %d\n", size
);
5062 ok(type
== REG_MULTI_SZ
, "Expected REG_MULTI_SZ, got %d\n", type
);
5066 memset(buf
, 0, size
);
5067 res
= RegQueryValueExA(hkey
, "Value8", NULL
, &type
, buf
, &size
);
5068 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5069 ok(*(DWORD
*)buf
== 1, "got %u\n", *(DWORD
*)buf
);
5070 ok(size
== 4, "got %u\n", size
);
5071 ok(type
== REG_DWORD
, "got %u\n", type
);
5075 memset(buf
, 0, size
);
5076 res
= RegQueryValueExA(hkey
, "Value9", NULL
, &type
, buf
, &size
);
5077 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5078 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5079 ok(size
== 1, "got %u\n", size
);
5080 ok(type
== REG_BINARY
, "got %u\n", type
);
5084 memset(buf
, 0, size
);
5085 res
= RegQueryValueExA(hkey
, "Value10", NULL
, &type
, buf
, &size
);
5086 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5087 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5088 ok(size
== 1, "got %u\n", size
);
5089 ok(type
== REG_BINARY
, "got %u\n", type
);
5093 memset(buf
, 0, size
);
5094 res
= RegQueryValueExA(hkey
, "Value11", NULL
, &type
, buf
, &size
);
5095 ok(res
== ERROR_SUCCESS
, "got %u\n", res
);
5096 ok(buf
[0] == 1, "got %u\n", buf
[0]);
5097 ok(size
== 1, "got %u\n", size
);
5098 ok(type
== REG_BINARY
, "got %u\n", type
);
5100 RegDeleteValueA(hkey
, "Value");
5101 RegDeleteValueA(hkey
, "Value1");
5102 RegDeleteValueA(hkey
, "Value2");
5103 RegDeleteValueA(hkey
, "Value3");
5104 RegDeleteValueA(hkey
, "Value4");
5105 RegDeleteValueA(hkey
, "Value5");
5106 RegDeleteValueA(hkey
, "Value6");
5107 RegDeleteValueA(hkey
, "Value7");
5108 RegDeleteValueA(hkey
, "Value8");
5109 RegDeleteValueA(hkey
, "Value9");
5110 RegDeleteValueA(hkey
, "Value10");
5111 RegDeleteValueA(hkey
, "Value11");
5113 RegDeleteKeyA(HKEY_LOCAL_MACHINE
, "SOFTWARE\\Wine\\msitest");
5116 DeleteFileA(msifile
);
5117 DeleteFileA("msitest\\augustus");
5118 RemoveDirectoryA("msitest");
5121 static void test_envvar(void)
5123 static const char *results
[] =
5125 "1;2", /* MSITESTVAR11 */
5126 "1", /* MSITESTVAR12 */
5127 "1;2", /* MSITESTVAR13 */
5128 ";1;", /* MSITESTVAR14 */
5129 ";;1;;", /* MSITESTVAR15 */
5130 " 1 ", /* MSITESTVAR16 */
5131 ";;2;;1", /* MSITESTVAR17 */
5132 "1;;2;;", /* MSITESTVAR18 */
5133 "1", /* MSITESTVAR19 */
5134 "1", /* MSITESTVAR20 */
5135 "1", /* MSITESTVAR21 */
5145 if (is_process_limited())
5147 skip("process is limited\n");
5151 create_test_files();
5152 create_database(msifile
, env_tables
, sizeof(env_tables
) / sizeof(msi_table
));
5154 res
= RegCreateKeyExA(HKEY_CURRENT_USER
, "Environment", 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &env
, NULL
);
5155 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5157 res
= RegSetValueExA(env
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"0", 2);
5158 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5160 res
= RegSetValueExA(env
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"0", 2);
5161 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5163 res
= RegSetValueExA(env
, "MSITESTVAR21", 0, REG_SZ
, (const BYTE
*)"1", 2);
5164 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5166 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5168 r
= MsiInstallProductA(msifile
, NULL
);
5169 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5171 skip("Not enough rights to perform tests\n");
5174 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5177 size
= sizeof(buffer
);
5179 res
= RegQueryValueExA(env
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5180 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5181 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5182 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5184 res
= RegDeleteValueA(env
, "MSITESTVAR1");
5185 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5188 size
= sizeof(buffer
);
5190 res
= RegQueryValueExA(env
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
5191 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5192 ok(type
== REG_SZ
, "Expected REG_SZ, got %u\n", type
);
5193 ok(!lstrcmpA(buffer
, "1"), "Expected \"1\", got %s\n", buffer
);
5195 res
= RegDeleteValueA(env
, "MSITESTVAR2");
5196 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5198 res
= RegDeleteValueA(env
, "MSITESTVAR3");
5199 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5201 res
= RegDeleteValueA(env
, "MSITESTVAR4");
5202 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5204 res
= RegDeleteValueA(env
, "MSITESTVAR5");
5205 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5207 res
= RegDeleteValueA(env
, "MSITESTVAR6");
5208 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5210 res
= RegDeleteValueA(env
, "MSITESTVAR7");
5211 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5213 res
= RegDeleteValueA(env
, "MSITESTVAR8");
5214 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5216 res
= RegDeleteValueA(env
, "MSITESTVAR9");
5217 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5219 res
= RegDeleteValueA(env
, "MSITESTVAR10");
5220 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
5223 while (results
[i
- 11])
5226 sprintf(name
, "MSITESTVAR%d", i
);
5229 size
= sizeof(buffer
);
5231 res
= RegQueryValueExA(env
, name
, NULL
, &type
, (LPBYTE
)buffer
, &size
);
5232 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5233 ok(type
== REG_SZ
, "%d: Expected REG_SZ, got %u\n", i
, type
);
5234 ok(!lstrcmpA(buffer
, results
[i
- 11]), "%d: Expected %s, got %s\n", i
, results
[i
- 11], buffer
);
5236 res
= RegDeleteValueA(env
, name
);
5237 ok(res
== ERROR_SUCCESS
, "%d: Expected ERROR_SUCCESS, got %d\n", i
, res
);
5241 delete_pf("msitest\\cabout\\new\\five.txt", TRUE
);
5242 delete_pf("msitest\\cabout\\new", FALSE
);
5243 delete_pf("msitest\\cabout\\four.txt", TRUE
);
5244 delete_pf("msitest\\cabout", FALSE
);
5245 delete_pf("msitest\\changed\\three.txt", TRUE
);
5246 delete_pf("msitest\\changed", FALSE
);
5247 delete_pf("msitest\\first\\two.txt", TRUE
);
5248 delete_pf("msitest\\first", FALSE
);
5249 delete_pf("msitest\\filename", TRUE
);
5250 delete_pf("msitest\\one.txt", TRUE
);
5251 delete_pf("msitest\\service.exe", TRUE
);
5252 delete_pf("msitest\\service2.exe", TRUE
);
5253 delete_pf("msitest", FALSE
);
5256 RegDeleteValueA(env
, "MSITESTVAR1");
5257 RegDeleteValueA(env
, "MSITESTVAR2");
5258 RegDeleteValueA(env
, "MSITESTVAR21");
5261 delete_test_files();
5262 DeleteFileA(msifile
);
5265 static void test_create_remove_folder(void)
5269 if (is_process_limited())
5271 skip("process is limited\n");
5275 CreateDirectoryA("msitest", NULL
);
5276 CreateDirectoryA("msitest\\first", NULL
);
5277 CreateDirectoryA("msitest\\second", NULL
);
5278 create_file("msitest\\first\\one.txt", 1000);
5279 create_file("msitest\\second\\two.txt", 1000);
5280 create_database(msifile
, cf_tables
, sizeof(cf_tables
) / sizeof(msi_table
));
5282 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5284 r
= MsiInstallProductA(msifile
, NULL
);
5285 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5287 skip("Not enough rights to perform tests\n");
5290 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5292 ok(pf_exists("msitest\\first\\one.txt"), "file not installed\n");
5293 ok(pf_exists("msitest\\first"), "directory not created\n");
5294 ok(pf_exists("msitest\\second\\two.txt"), "file not installed\n");
5295 ok(pf_exists("msitest\\second"), "directory not created\n");
5296 ok(pf_exists("msitest\\third"), "directory not created\n");
5297 ok(pf_exists("msitest"), "directory not created\n");
5299 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5300 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5302 ok(!pf_exists("msitest\\first\\one.txt"), "file not removed\n");
5303 ok(!pf_exists("msitest\\first"), "directory not removed\n");
5304 ok(!pf_exists("msitest\\second\\two.txt"), "file not removed\n");
5305 ok(!pf_exists("msitest\\second"), "directory not removed\n");
5306 ok(!pf_exists("msitest\\third"), "directory not removed\n");
5307 todo_wine
ok(!pf_exists("msitest"), "directory not removed\n");
5310 DeleteFileA("msitest\\first\\one.txt");
5311 DeleteFileA("msitest\\second\\two.txt");
5312 RemoveDirectoryA("msitest\\first");
5313 RemoveDirectoryA("msitest\\second");
5314 RemoveDirectoryA("msitest");
5315 DeleteFileA(msifile
);
5318 static void test_start_stop_services(void)
5321 SC_HANDLE scm
, service
;
5323 DWORD error
= ERROR_SUCCESS
;
5325 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5326 if (!scm
&& GetLastError() == ERROR_ACCESS_DENIED
)
5328 skip("Not enough rights to perform tests\n");
5331 ok(scm
!= NULL
, "Failed to open the SC Manager\n");
5334 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5335 if (!service
&& GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST
)
5337 win_skip("The 'Spooler' service does not exist\n");
5338 CloseServiceHandle(scm
);
5341 ok(service
!= NULL
, "Failed to open Spooler, error %d\n", GetLastError());
5343 CloseServiceHandle(scm
);
5347 ret
= StartServiceA(service
, 0, NULL
);
5348 if (!ret
&& (error
= GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING
)
5350 skip("Spooler service not available, skipping test\n");
5351 CloseServiceHandle(service
);
5352 CloseServiceHandle(scm
);
5356 CloseServiceHandle(service
);
5357 CloseServiceHandle(scm
);
5359 create_test_files();
5360 create_database(msifile
, sss_tables
, sizeof(sss_tables
) / sizeof(msi_table
));
5362 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5364 r
= MsiInstallProductA(msifile
, NULL
);
5365 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5367 if (error
== ERROR_SUCCESS
)
5369 SERVICE_STATUS status
;
5371 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5372 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5374 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5375 ok(ret
, "ControlService failed %u\n", GetLastError());
5377 CloseServiceHandle(service
);
5378 CloseServiceHandle(scm
);
5381 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5382 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5384 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5385 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5386 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5387 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5388 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5389 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5390 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5391 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5392 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5393 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5394 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5395 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5396 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5398 if (error
== ERROR_SUCCESS
)
5400 SERVICE_STATUS status
;
5402 scm
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5403 service
= OpenServiceA(scm
, "Spooler", SC_MANAGER_ALL_ACCESS
);
5405 ret
= ControlService(service
, SERVICE_CONTROL_STOP
, &status
);
5406 ok(ret
, "ControlService failed %u\n", GetLastError());
5408 CloseServiceHandle(service
);
5409 CloseServiceHandle(scm
);
5412 delete_test_files();
5413 DeleteFileA(msifile
);
5416 static void delete_test_service(const char *name
)
5419 SC_HANDLE manager
, service
;
5421 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5422 ok(manager
!= NULL
, "can't open service manager\n");
5423 if (!manager
) return;
5425 service
= OpenServiceA(manager
, name
, GENERIC_ALL
);
5428 ret
= DeleteService( service
);
5429 ok( ret
, "failed to delete service %u\n", GetLastError() );
5430 CloseServiceHandle(service
);
5432 CloseServiceHandle(manager
);
5435 static void test_delete_services(void)
5438 SC_HANDLE manager
, service
;
5441 if (is_process_limited())
5443 skip("process is limited\n");
5447 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5448 ok(manager
!= NULL
, "can't open service manager %u\n", GetLastError());
5449 if (!manager
) return;
5451 service
= CreateServiceA(manager
, "TestService3", "TestService3",
5452 SERVICE_ALL_ACCESS
, SERVICE_WIN32_OWN_PROCESS
, SERVICE_DEMAND_START
,
5453 SERVICE_ERROR_NORMAL
, "C:\\doesnt_exist.exe", NULL
, NULL
, NULL
, NULL
, NULL
);
5454 ok(service
!= NULL
, "can't create service %u\n", GetLastError());
5455 CloseServiceHandle(service
);
5456 CloseServiceHandle(manager
);
5457 if (!service
) return;
5459 create_test_files();
5460 create_database(msifile
, sds_tables
, sizeof(sds_tables
) / sizeof(msi_table
));
5462 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5464 r
= MsiInstallProductA(msifile
, NULL
);
5465 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5467 skip("Not enough rights to perform tests\n");
5470 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5472 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5473 ok(manager
!= NULL
, "can't open service manager\n");
5474 if (!manager
) goto error
;
5476 service
= OpenServiceA(manager
, "TestService3", GENERIC_ALL
);
5477 error
= GetLastError();
5478 ok(service
== NULL
, "TestService3 not deleted\n");
5479 ok(error
== ERROR_SERVICE_DOES_NOT_EXIST
, "wrong error %u\n", error
);
5480 CloseServiceHandle(manager
);
5482 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5483 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5485 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5486 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5487 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5488 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5489 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5490 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5491 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5492 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5493 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5494 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5495 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5496 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5497 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5500 delete_test_service("TestService");
5501 delete_test_service("TestService2");
5502 delete_test_service("TestService3");
5503 delete_test_files();
5504 DeleteFileA(msifile
);
5507 static void test_install_services(void)
5510 SC_HANDLE manager
, service
;
5513 DWORD err_control
, err_controlsize
, err_controltype
;
5515 if (is_process_limited())
5517 skip("process is limited\n");
5521 create_test_files();
5522 create_database(msifile
, sis_tables
, sizeof(sis_tables
) / sizeof(msi_table
));
5524 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5526 r
= MsiInstallProductA(msifile
, NULL
);
5527 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5529 skip("Not enough rights to perform tests\n");
5532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5534 manager
= OpenSCManagerA(NULL
, NULL
, SC_MANAGER_ALL_ACCESS
);
5535 ok(manager
!= NULL
, "can't open service manager\n");
5536 if (!manager
) goto error
;
5538 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5539 ok(service
!= NULL
, "TestService not installed\n");
5540 CloseServiceHandle(service
);
5542 service
= OpenServiceA(manager
, "TestService4", GENERIC_ALL
);
5543 ok(service
== NULL
, "TestService4 installed\n");
5545 res
= RegOpenKeyA(HKEY_LOCAL_MACHINE
, "SYSTEM\\CurrentControlSet\\Services\\TestService", &hKey
);
5546 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
5548 if (res
== ERROR_SUCCESS
)
5550 err_control
= 0xBEEF;
5551 err_controltype
= REG_DWORD
;
5552 err_controlsize
= sizeof(err_control
);
5553 res
= RegQueryValueExA(hKey
, "ErrorControl", NULL
, &err_controltype
, (LPBYTE
)&err_control
, &err_controlsize
);
5554 ok(err_control
== 0, "TestService.ErrorControl wrong, expected 0, got %u\n", err_control
);
5558 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5559 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5561 service
= OpenServiceA(manager
, "TestService", GENERIC_ALL
);
5562 ok(service
!= NULL
, "TestService deleted\n");
5563 CloseServiceHandle(service
);
5564 CloseServiceHandle(manager
);
5566 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5567 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5568 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5569 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5570 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5571 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5572 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5573 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5574 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5575 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5576 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5577 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5578 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5581 delete_test_service("TestService");
5582 delete_test_files();
5583 DeleteFileA(msifile
);
5586 static void test_self_registration(void)
5590 if (is_process_limited())
5592 skip("process is limited\n");
5596 create_test_files();
5597 create_database(msifile
, sr_tables
, sizeof(sr_tables
) / sizeof(msi_table
));
5599 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5601 r
= MsiInstallProductA(msifile
, NULL
);
5602 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5604 skip("Not enough rights to perform tests\n");
5607 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5609 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5610 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5611 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5612 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5613 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5614 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5615 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5616 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5617 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5618 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5619 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5620 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5621 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5624 delete_test_files();
5625 DeleteFileA(msifile
);
5628 static void test_register_font(void)
5630 static const char regfont1
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
5631 static const char regfont2
[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
5635 REGSAM access
= KEY_ALL_ACCESS
;
5637 if (is_process_limited())
5639 skip("process is limited\n");
5643 create_test_files();
5644 create_file("msitest\\font.ttf", 1000);
5645 create_database(msifile
, font_tables
, sizeof(font_tables
) / sizeof(msi_table
));
5648 access
|= KEY_WOW64_64KEY
;
5650 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5652 r
= MsiInstallProductA(msifile
, NULL
);
5653 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5655 skip("Not enough rights to perform tests\n");
5658 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5660 ret
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont1
, 0, access
, &key
);
5662 RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regfont2
, 0, access
, &key
);
5664 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5665 ok(ret
!= ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5667 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5668 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5670 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5672 ret
= RegQueryValueExA(key
, "msi test font", NULL
, NULL
, NULL
, NULL
);
5673 ok(ret
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", ret
);
5675 RegDeleteValueA(key
, "msi test font");
5679 DeleteFileA("msitest\\font.ttf");
5680 delete_test_files();
5681 DeleteFileA(msifile
);
5684 static void test_validate_product_id(void)
5688 if (is_process_limited())
5690 skip("process is limited\n");
5694 create_test_files();
5695 create_database(msifile
, vp_tables
, sizeof(vp_tables
) / sizeof(msi_table
));
5697 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5699 r
= MsiInstallProductA(msifile
, NULL
);
5700 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5702 skip("Not enough rights to perform tests\n");
5705 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5707 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=1");
5708 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5710 r
= MsiInstallProductA(msifile
, "SET_PRODUCT_ID=2");
5711 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5713 r
= MsiInstallProductA(msifile
, "PIDKEY=123-1234567");
5714 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5716 ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE
), "File not installed\n");
5717 ok(delete_pf("msitest\\cabout\\new", FALSE
), "Directory not created\n");
5718 ok(delete_pf("msitest\\cabout\\four.txt", TRUE
), "File not installed\n");
5719 ok(delete_pf("msitest\\cabout", FALSE
), "Directory not created\n");
5720 ok(delete_pf("msitest\\changed\\three.txt", TRUE
), "File not installed\n");
5721 ok(delete_pf("msitest\\changed", FALSE
), "Directory not created\n");
5722 ok(delete_pf("msitest\\first\\two.txt", TRUE
), "File not installed\n");
5723 ok(delete_pf("msitest\\first", FALSE
), "Directory not created\n");
5724 ok(delete_pf("msitest\\filename", TRUE
), "File not installed\n");
5725 ok(delete_pf("msitest\\one.txt", TRUE
), "File not installed\n");
5726 ok(delete_pf("msitest\\service.exe", TRUE
), "File not installed\n");
5727 ok(delete_pf("msitest\\service2.exe", TRUE
), "File not installed\n");
5728 ok(delete_pf("msitest", FALSE
), "Directory not created\n");
5731 delete_test_files();
5732 DeleteFileA(msifile
);
5735 static void test_install_remove_odbc(void)
5739 if (is_process_limited())
5741 skip("process is limited\n");
5745 create_test_files();
5746 create_file("msitest\\ODBCdriver.dll", 1000);
5747 create_file("msitest\\ODBCdriver2.dll", 1000);
5748 create_file("msitest\\ODBCtranslator.dll", 1000);
5749 create_file("msitest\\ODBCtranslator2.dll", 1000);
5750 create_file("msitest\\ODBCsetup.dll", 1000);
5751 create_database(msifile
, odbc_tables
, sizeof(odbc_tables
) / sizeof(msi_table
));
5753 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5755 r
= MsiInstallProductA(msifile
, NULL
);
5756 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5758 skip("Not enough rights to perform tests\n");
5761 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5763 ok(pf_exists("msitest\\ODBCdriver.dll"), "file not created\n");
5764 ok(pf_exists("msitest\\ODBCdriver2.dll"), "file not created\n");
5765 ok(pf_exists("msitest\\ODBCtranslator.dll"), "file not created\n");
5766 ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
5767 ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
5769 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5770 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5772 ok(!delete_pf("msitest\\ODBCdriver.dll", TRUE
), "file not removed\n");
5773 ok(!delete_pf("msitest\\ODBCdriver2.dll", TRUE
), "file not removed\n");
5774 ok(!delete_pf("msitest\\ODBCtranslator.dll", TRUE
), "file not removed\n");
5775 ok(!delete_pf("msitest\\ODBCtranslator2.dll", TRUE
), "file not removed\n");
5776 ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE
), "file not removed\n");
5777 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5780 DeleteFileA("msitest\\ODBCdriver.dll");
5781 DeleteFileA("msitest\\ODBCdriver2.dll");
5782 DeleteFileA("msitest\\ODBCtranslator.dll");
5783 DeleteFileA("msitest\\ODBCtranslator2.dll");
5784 DeleteFileA("msitest\\ODBCsetup.dll");
5785 delete_test_files();
5786 DeleteFileA(msifile
);
5789 static void test_register_typelib(void)
5793 if (is_process_limited())
5795 skip("process is limited\n");
5799 create_test_files();
5800 create_file("msitest\\typelib.dll", 1000);
5801 create_database(msifile
, tl_tables
, sizeof(tl_tables
) / sizeof(msi_table
));
5803 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5805 r
= MsiInstallProductA(msifile
, "REGISTER_TYPELIB=1");
5806 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5808 skip("Not enough rights to perform tests\n");
5811 ok(r
== ERROR_INSTALL_FAILURE
, "Expected ERROR_INSTALL_FAILURE, got %u\n", r
);
5813 r
= MsiInstallProductA(msifile
, NULL
);
5814 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5816 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5817 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5819 ok(!delete_pf("msitest\\typelib.dll", TRUE
), "file not removed\n");
5820 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5823 DeleteFileA("msitest\\typelib.dll");
5824 delete_test_files();
5825 DeleteFileA(msifile
);
5828 static void test_create_remove_shortcut(void)
5832 if (is_process_limited())
5834 skip("process is limited\n");
5838 create_test_files();
5839 create_file("msitest\\target.txt", 1000);
5840 create_database(msifile
, crs_tables
, sizeof(crs_tables
) / sizeof(msi_table
));
5842 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5844 r
= MsiInstallProductA(msifile
, NULL
);
5845 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5847 skip("Not enough rights to perform tests\n");
5850 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5852 ok(pf_exists("msitest\\target.txt"), "file not created\n");
5853 ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n");
5855 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5856 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5858 ok(!delete_pf("msitest\\shortcut.lnk", TRUE
), "file not removed\n");
5859 ok(!delete_pf("msitest\\target.txt", TRUE
), "file not removed\n");
5860 todo_wine
ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5863 DeleteFileA("msitest\\target.txt");
5864 delete_test_files();
5865 DeleteFileA(msifile
);
5868 static void test_publish_components(void)
5870 static const char keypath
[] =
5871 "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5872 static const char keypath2
[] =
5873 "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA";
5881 if (is_process_limited())
5883 skip("process is limited\n");
5887 create_test_files();
5888 create_file("msitest\\english.txt", 1000);
5889 create_database(msifile
, pub_tables
, sizeof(pub_tables
) / sizeof(msi_table
));
5891 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5893 r
= MsiInstallProductA(msifile
, NULL
);
5894 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5896 skip("Not enough rights to perform tests\n");
5899 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5902 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5903 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5904 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5906 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5907 ok(res
== ERROR_SUCCESS
, "components key not created %d\n", res
);
5909 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, NULL
, &size
);
5910 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5912 data
= HeapAlloc(GetProcessHeap(), 0, size
);
5913 res
= RegQueryValueExA(key
, "english.txt", NULL
, NULL
, data
, &size
);
5914 ok(res
== ERROR_SUCCESS
, "value not found %d\n", res
);
5917 res
= RegDeleteKeyA(HKEY_CURRENT_USER
, keypath
);
5918 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5920 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, 0, NULL
, REG_OPTION_NON_VOLATILE
,
5921 MAXIMUM_ALLOWED
| KEY_WOW64_64KEY
, NULL
, &key
, NULL
);
5922 ok(res
== ERROR_SUCCESS
, "RegCreateKeyEx failed %d\n", res
);
5923 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5924 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5928 r
= MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}",
5929 "english.txt", INSTALLMODE_DEFAULT
, NULL
, &size
);
5930 ok(r
== ERROR_SUCCESS
, "MsiProvideQualifiedComponent returned %d\n", r
);
5932 if (pRegDeleteKeyExA
)
5933 res
= pRegDeleteKeyExA(HKEY_LOCAL_MACHINE
, keypath2
, KEY_WOW64_64KEY
, 0);
5935 res
= RegDeleteKeyA(HKEY_LOCAL_MACHINE
, keypath2
);
5936 ok(res
== ERROR_SUCCESS
, "RegDeleteKey failed %d\n", res
);
5938 res
= RegCreateKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5939 ok(res
== ERROR_SUCCESS
, "RegCreateKey failed %d\n", res
);
5941 res
= RegSetValueExA(key
, "english.txt", 0, REG_MULTI_SZ
, data
, size
);
5942 ok(res
== ERROR_SUCCESS
, "RegSetValueEx failed %d\n", res
);
5943 HeapFree(GetProcessHeap(), 0, data
);
5946 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5947 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5949 res
= RegOpenKeyA(HKEY_CURRENT_USER
, keypath
, &key
);
5950 ok(res
== ERROR_FILE_NOT_FOUND
, "unexpected result %d\n", res
);
5952 ok(!delete_pf("msitest\\english.txt", TRUE
), "file not removed\n");
5953 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
5956 DeleteFileA("msitest\\english.txt");
5957 delete_test_files();
5958 DeleteFileA(msifile
);
5961 static void test_remove_duplicate_files(void)
5965 if (is_process_limited())
5967 skip("process is limited\n");
5971 create_test_files();
5972 create_file("msitest\\original.txt", 1000);
5973 create_file("msitest\\original2.txt", 1000);
5974 create_file("msitest\\original3.txt", 1000);
5975 create_database(msifile
, rd_tables
, sizeof(rd_tables
) / sizeof(msi_table
));
5977 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
5979 r
= MsiInstallProductA(msifile
, NULL
);
5980 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
5982 skip("Not enough rights to perform tests\n");
5985 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5987 ok(pf_exists("msitest\\original.txt"), "file not created\n");
5988 ok(pf_exists("msitest\\original2.txt"), "file not created\n");
5989 ok(!pf_exists("msitest\\original3.txt"), "file created\n");
5990 ok(pf_exists("msitest\\duplicate.txt"), "file not created\n");
5991 ok(!pf_exists("msitest\\duplicate2.txt"), "file created\n");
5993 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
5994 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
5996 ok(delete_pf("msitest\\original.txt", TRUE
), "file removed\n");
5997 ok(!delete_pf("msitest\\original2.txt", TRUE
), "file not removed\n");
5998 ok(!delete_pf("msitest\\original3.txt", TRUE
), "file not removed\n");
5999 ok(!delete_pf("msitest\\duplicate.txt", TRUE
), "file not removed\n");
6000 ok(!delete_pf("msitest\\duplicate2.txt", TRUE
), "file not removed\n");
6001 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6004 DeleteFileA("msitest\\original.txt");
6005 DeleteFileA("msitest\\original2.txt");
6006 DeleteFileA("msitest\\original3.txt");
6007 delete_test_files();
6008 DeleteFileA(msifile
);
6011 static void test_remove_registry_values(void)
6016 REGSAM access
= KEY_ALL_ACCESS
;
6018 if (is_process_limited())
6020 skip("process is limited\n");
6024 create_test_files();
6025 create_file("msitest\\registry.txt", 1000);
6026 create_database(msifile
, rrv_tables
, sizeof(rrv_tables
) / sizeof(msi_table
));
6029 access
|= KEY_WOW64_64KEY
;
6031 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6033 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6034 RegSetValueExA(key
, "value1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6037 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6038 RegSetValueExA(key
, "value2", 0, REG_SZ
, (const BYTE
*)"2", 2);
6041 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6042 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
6043 RegSetValueExA(key
, "valueA", 0, REG_SZ
, (const BYTE
*)"A", 2);
6044 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
6047 RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6048 RegSetValueExA(key
, "", 0, REG_SZ
, (const BYTE
*)"default", 8);
6049 RegSetValueExA(key
, "valueB", 0, REG_SZ
, (const BYTE
*)"B", 2);
6052 r
= MsiInstallProductA(msifile
, NULL
);
6053 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6055 skip("Not enough rights to perform tests\n");
6058 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6060 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, access
, &key
);
6061 ok(res
== ERROR_SUCCESS
, "key removed\n");
6066 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
6067 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6071 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS
, &key
);
6072 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6075 res
= RegCreateKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, NULL
, 0, access
, NULL
, &key
, NULL
);
6076 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6079 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6080 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6084 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6085 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6089 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS
, &key
);
6090 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6093 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", 0, access
, &key
);
6094 ok(res
== ERROR_SUCCESS
, "key removed\n");
6097 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", 0, access
, &key
);
6098 ok(res
== ERROR_SUCCESS
, "key removed\n");
6103 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6104 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6108 res
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS
, &key
);
6109 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6112 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6113 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6114 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine", access
);
6116 ok(!delete_pf("msitest\\registry.txt", TRUE
), "file not removed\n");
6117 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6120 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key1", access
);
6121 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\key2", access
);
6122 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyA", access
);
6123 delete_key(HKEY_LOCAL_MACHINE
, "Software\\Wine\\keyB", access
);
6125 DeleteFileA("msitest\\registry.txt");
6126 delete_test_files();
6127 DeleteFileA(msifile
);
6130 static void test_find_related_products(void)
6134 if (is_process_limited())
6136 skip("process is limited\n");
6140 create_test_files();
6141 create_file("msitest\\product.txt", 1000);
6142 create_database(msifile
, frp_tables
, sizeof(frp_tables
) / sizeof(msi_table
));
6144 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6146 r
= MsiInstallProductA(msifile
, NULL
);
6147 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6149 skip("Not enough rights to perform tests\n");
6152 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6154 /* install again, so it finds the upgrade code */
6155 r
= MsiInstallProductA(msifile
, NULL
);
6156 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6158 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6159 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6161 ok(!delete_pf("msitest\\product.txt", TRUE
), "file not removed\n");
6162 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6165 DeleteFileA("msitest\\product.txt");
6166 delete_test_files();
6167 DeleteFileA(msifile
);
6170 static void test_remove_ini_values(void)
6174 char inifile
[MAX_PATH
], buf
[0x10];
6178 if (is_process_limited())
6180 skip("process is limited\n");
6184 create_test_files();
6185 create_file("msitest\\inifile.txt", 1000);
6186 create_database(msifile
, riv_tables
, sizeof(riv_tables
) / sizeof(msi_table
));
6188 lstrcpyA(inifile
, PROG_FILES_DIR
);
6189 lstrcatA(inifile
, "\\msitest");
6190 ret
= CreateDirectoryA(inifile
, NULL
);
6191 if (!ret
&& GetLastError() == ERROR_ACCESS_DENIED
)
6193 skip("Not enough rights to perform tests\n");
6196 lstrcatA(inifile
, "\\test.ini");
6197 file
= CreateFileA(inifile
, GENERIC_WRITE
|GENERIC_READ
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
6200 ret
= WritePrivateProfileStringA("section1", "key1", "value1", inifile
);
6201 ok(ret
, "failed to write profile string %u\n", GetLastError());
6203 ret
= WritePrivateProfileStringA("sectionA", "keyA", "valueA", inifile
);
6204 ok(ret
, "failed to write profile string %u\n", GetLastError());
6206 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6208 r
= MsiInstallProductA(msifile
, NULL
);
6209 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6211 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6212 ok(len
== 6, "got %u expected 6\n", len
);
6214 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6215 ok(!len
, "got %u expected 0\n", len
);
6217 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6218 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6220 len
= GetPrivateProfileStringA("section1", "key1", NULL
, buf
, sizeof(buf
), inifile
);
6221 ok(!len
, "got %u expected 0\n", len
);
6223 len
= GetPrivateProfileStringA("sectionA", "keyA", NULL
, buf
, sizeof(buf
), inifile
);
6224 ok(!len
, "got %u expected 0\n", len
);
6226 todo_wine
ok(!delete_pf("msitest\\test.ini", TRUE
), "file removed\n");
6227 ok(!delete_pf("msitest\\inifile.txt", TRUE
), "file not removed\n");
6228 ok(delete_pf("msitest", FALSE
), "directory removed\n");
6231 DeleteFileA("msitest\\inifile.txt");
6232 delete_test_files();
6233 DeleteFileA(msifile
);
6236 static void test_remove_env_strings(void)
6244 if (is_process_limited())
6246 skip("process is limited\n");
6250 create_test_files();
6251 create_file("msitest\\envvar.txt", 1000);
6252 create_database(msifile
, res_tables
, sizeof(res_tables
) / sizeof(msi_table
));
6254 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6256 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6257 ok(!res
, "failed to open environment key %d\n", res
);
6259 RegSetValueExA(key
, "MSITESTVAR1", 0, REG_SZ
, (const BYTE
*)"1", 2);
6260 RegSetValueExA(key
, "MSITESTVAR2", 0, REG_SZ
, (const BYTE
*)"1", 2);
6261 RegSetValueExA(key
, "MSITESTVAR3", 0, REG_SZ
, (const BYTE
*)"1", 2);
6262 RegSetValueExA(key
, "MSITESTVAR4", 0, REG_SZ
, (const BYTE
*)"1", 2);
6263 RegSetValueExA(key
, "MSITESTVAR5", 0, REG_SZ
, (const BYTE
*)"1", 2);
6264 RegSetValueExA(key
, "MSITESTVAR6", 0, REG_SZ
, (const BYTE
*)"1;2", 4);
6265 RegSetValueExA(key
, "MSITESTVAR7", 0, REG_SZ
, (const BYTE
*)"1;2", 4);
6266 RegSetValueExA(key
, "MSITESTVAR8", 0, REG_SZ
, (const BYTE
*)"2;1;0", 6);
6267 RegSetValueExA(key
, "MSITESTVAR9", 0, REG_SZ
, (const BYTE
*)"0;1;2", 6);
6268 RegSetValueExA(key
, "MSITESTVAR10", 0, REG_SZ
, (const BYTE
*)"1", 2);
6269 RegSetValueExA(key
, "MSITESTVAR11", 0, REG_SZ
, (const BYTE
*)"1", 2);
6273 r
= MsiInstallProductA(msifile
, NULL
);
6274 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6276 skip("Not enough rights to perform tests\n");
6279 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6281 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6282 ok(!res
, "failed to open environment key %d\n", res
);
6286 size
= sizeof(buffer
);
6287 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6288 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6289 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6290 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6294 size
= sizeof(buffer
);
6295 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6296 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6297 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6298 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6302 size
= sizeof(buffer
);
6303 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6304 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6305 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6306 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6310 size
= sizeof(buffer
);
6311 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6312 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6313 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6314 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6318 size
= sizeof(buffer
);
6319 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6320 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6321 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6322 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6326 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6327 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6329 res
= RegOpenKeyA(HKEY_CURRENT_USER
, "Environment", &key
);
6330 ok(!res
, "failed to open environment key %d\n", res
);
6332 res
= RegQueryValueExA(key
, "MSITESTVAR1", NULL
, NULL
, NULL
, NULL
);
6333 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6335 res
= RegQueryValueExA(key
, "MSITESTVAR2", NULL
, NULL
, NULL
, NULL
);
6336 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6340 size
= sizeof(buffer
);
6341 res
= RegQueryValueExA(key
, "MSITESTVAR3", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6342 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6343 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6344 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6345 RegDeleteValueA(key
, "MSITESTVAR3");
6347 res
= RegQueryValueExA(key
, "MSITESTVAR4", NULL
, NULL
, NULL
, NULL
);
6348 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6352 size
= sizeof(buffer
);
6353 res
= RegQueryValueExA(key
, "MSITESTVAR5", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6354 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6355 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6356 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6357 RegDeleteValueA(key
, "MSITESTVAR5");
6361 size
= sizeof(buffer
);
6362 res
= RegQueryValueExA(key
, "MSITESTVAR6", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6363 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6364 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6365 ok(!lstrcmpA(buffer
, "2"), "expected \"2\", got \"%s\"\n", buffer
);
6366 RegDeleteValueA(key
, "MSITESTVAR6");
6370 size
= sizeof(buffer
);
6371 res
= RegQueryValueExA(key
, "MSITESTVAR7", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6372 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6373 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6374 ok(!lstrcmpA(buffer
, "2"), "expected \"2\", got \"%s\"\n", buffer
);
6375 RegDeleteValueA(key
, "MSITESTVAR7");
6379 size
= sizeof(buffer
);
6380 res
= RegQueryValueExA(key
, "MSITESTVAR8", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6381 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6382 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6383 ok(!lstrcmpA(buffer
, "2;0"), "expected \"2;0\", got \"%s\"\n", buffer
);
6384 RegDeleteValueA(key
, "MSITESTVAR8");
6388 size
= sizeof(buffer
);
6389 res
= RegQueryValueExA(key
, "MSITESTVAR9", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6390 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6391 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6392 ok(!lstrcmpA(buffer
, "0;2"), "expected \"0;2\", got \"%s\"\n", buffer
);
6393 RegDeleteValueA(key
, "MSITESTVAR9");
6397 size
= sizeof(buffer
);
6398 res
= RegQueryValueExA(key
, "MSITESTVAR10", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6399 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6403 size
= sizeof(buffer
);
6404 res
= RegQueryValueExA(key
, "MSITESTVAR11", NULL
, &type
, (LPBYTE
)buffer
, &size
);
6405 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6406 ok(type
== REG_SZ
, "expected REG_SZ, got %u\n", type
);
6407 ok(!lstrcmpA(buffer
, "1"), "expected \"1\", got \"%s\"\n", buffer
);
6408 RegDeleteValueA(key
, "MSITESTVAR11");
6410 ok(!delete_pf("msitest\\envvar.txt", TRUE
), "file not removed\n");
6411 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6414 RegDeleteValueA(key
, "MSITESTVAR1");
6415 RegDeleteValueA(key
, "MSITESTVAR2");
6416 RegDeleteValueA(key
, "MSITESTVAR3");
6417 RegDeleteValueA(key
, "MSITESTVAR4");
6418 RegDeleteValueA(key
, "MSITESTVAR5");
6419 RegDeleteValueA(key
, "MSITESTVAR6");
6420 RegDeleteValueA(key
, "MSITESTVAR7");
6421 RegDeleteValueA(key
, "MSITESTVAR8");
6422 RegDeleteValueA(key
, "MSITESTVAR9");
6423 RegDeleteValueA(key
, "MSITESTVAR10");
6424 RegDeleteValueA(key
, "MSITESTVAR11");
6427 DeleteFileA("msitest\\envvar.txt");
6428 delete_test_files();
6429 DeleteFileA(msifile
);
6432 static void test_register_class_info(void)
6438 if (is_process_limited())
6440 skip("process is limited\n");
6444 create_test_files();
6445 create_file("msitest\\class.txt", 1000);
6446 create_database(msifile
, rci_tables
, sizeof(rci_tables
) / sizeof(msi_table
));
6448 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6450 r
= MsiInstallProductA(msifile
, NULL
);
6451 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6453 skip("Not enough rights to perform tests\n");
6456 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6459 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6461 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6462 ok(res
== ERROR_SUCCESS
, "key not created\n");
6465 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6466 ok(res
== ERROR_SUCCESS
, "key not created\n");
6469 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6470 ok(res
== ERROR_SUCCESS
, "key not created\n");
6473 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6474 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6477 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6479 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6480 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6482 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6483 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6485 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &hkey
);
6486 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6488 ok(!delete_pf("msitest\\class.txt", TRUE
), "file not removed\n");
6489 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6492 DeleteFileA("msitest\\class.txt");
6493 delete_test_files();
6494 DeleteFileA(msifile
);
6497 static void test_register_extension_info(void)
6503 if (is_process_limited())
6505 skip("process is limited\n");
6509 create_test_files();
6510 create_file("msitest\\extension.txt", 1000);
6511 create_database(msifile
, rei_tables
, sizeof(rei_tables
) / sizeof(msi_table
));
6513 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6515 r
= MsiInstallProductA(msifile
, NULL
);
6516 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6518 skip("Not enough rights to perform tests\n");
6521 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6523 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6524 ok(res
== ERROR_SUCCESS
, "key not created\n");
6527 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1\\shell\\Open\\command", &hkey
);
6528 ok(res
== ERROR_SUCCESS
, "key not created\n");
6531 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6532 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6534 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, ".extension", &hkey
);
6535 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6537 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Prog.Id.1", &hkey
);
6538 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6540 ok(!delete_pf("msitest\\extension.txt", TRUE
), "file not removed\n");
6541 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6544 DeleteFileA("msitest\\extension.txt");
6545 delete_test_files();
6546 DeleteFileA(msifile
);
6549 static void test_register_progid_info(void)
6555 if (is_process_limited())
6557 skip("process is limited\n");
6561 create_test_files();
6562 create_file("msitest\\progid.txt", 1000);
6563 create_database(msifile
, rpi_tables
, sizeof(rpi_tables
) / sizeof(msi_table
));
6565 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", 0, NULL
, 0,
6566 KEY_ALL_ACCESS
, NULL
, &hkey
, NULL
);
6567 ok(res
== ERROR_SUCCESS
, "key not created\n");
6570 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6572 r
= MsiInstallProductA(msifile
, NULL
);
6573 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6575 skip("Not enough rights to perform tests\n");
6578 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6581 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6583 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6584 ok(res
== ERROR_SUCCESS
, "key not created\n");
6587 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6588 ok(res
== ERROR_SUCCESS
, "key not created\n");
6591 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6592 ok(res
== ERROR_SUCCESS
, "key not created\n");
6595 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6596 ok(res
== ERROR_SUCCESS
, "key not created\n");
6599 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6600 ok(res
== ERROR_SUCCESS
, "key not created\n");
6603 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6604 ok(res
== ERROR_SUCCESS
, "key not created\n");
6607 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6608 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6609 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6611 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6612 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6614 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6615 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6616 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6618 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6619 ok(res
== ERROR_FILE_NOT_FOUND
, "key created\n");
6621 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6622 ok(res
== ERROR_SUCCESS
, "key not created\n");
6625 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6626 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6629 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Wow6432Node\\CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6631 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &hkey
);
6632 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6634 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.1", &hkey
);
6635 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6637 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class", &hkey
);
6638 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6640 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Class.2", &hkey
);
6641 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6643 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass.1", &hkey
);
6644 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6646 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.VerClass", &hkey
);
6647 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6649 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass.1", &hkey
);
6650 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6652 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.NoProgIdClass", &hkey
);
6653 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6655 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned", &hkey
);
6656 ok(res
== ERROR_SUCCESS
, "key deleted\n");
6657 if (res
== ERROR_SUCCESS
) RegCloseKey(hkey
);
6659 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned2", &hkey
);
6660 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6662 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "Winetest.Extension", &hkey
);
6663 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6665 ok(!delete_pf("msitest\\progid.txt", TRUE
), "file not removed\n");
6666 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6669 DeleteFileA("msitest\\progid.txt");
6670 delete_test_files();
6671 DeleteFileA(msifile
);
6672 RegDeleteKeyA(HKEY_CLASSES_ROOT
, "Winetest.Orphaned");
6675 static void test_register_mime_info(void)
6681 if (is_process_limited())
6683 skip("process is limited\n");
6687 create_test_files();
6688 create_file("msitest\\mime.txt", 1000);
6689 create_database(msifile
, rmi_tables
, sizeof(rmi_tables
) / sizeof(msi_table
));
6691 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6693 r
= MsiInstallProductA(msifile
, NULL
);
6694 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6696 skip("Not enough rights to perform tests\n");
6699 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6701 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6702 ok(res
== ERROR_SUCCESS
, "key not created\n");
6705 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6706 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6708 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, "MIME\\Database\\Content Type\\mime/type", &hkey
);
6709 ok(res
== ERROR_FILE_NOT_FOUND
, "key not removed\n");
6711 ok(!delete_pf("msitest\\mime.txt", TRUE
), "file not removed\n");
6712 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6715 DeleteFileA("msitest\\mime.txt");
6716 delete_test_files();
6717 DeleteFileA(msifile
);
6720 static void test_publish_assemblies(void)
6722 static const char manifest
[] =
6723 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Assembly\" "
6724 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6725 "processorArchitecture=\"x86\"/>";
6726 static const char manifest_local
[] =
6727 "<assemblyIdentity type=\"win32\" name=\"Wine.Win32.Local.Assembly\" "
6728 "version=\"1.0.0.0\" publicKeyToken=\"abcdef0123456789\" "
6729 "processorArchitecture=\"x86\"/>";
6730 static const char classes_path_dotnet
[] =
6731 "Installer\\Assemblies\\Global";
6732 static const char classes_path_dotnet_local
[] =
6733 "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6734 static const char classes_path_dotnet_local_wow64
[] =
6735 "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6736 static const char classes_path_win32
[] =
6737 "Installer\\Win32Assemblies\\Global";
6738 static const char classes_path_win32_local
[] =
6739 "Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6740 static const char classes_path_win32_local_wow64
[] =
6741 "Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6742 static const char path_dotnet
[] =
6743 "Software\\Microsoft\\Installer\\Assemblies\\Global";
6744 static const char path_dotnet_local
[] =
6745 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt";
6746 static const char path_dotnet_local_wow64
[] =
6747 "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt";
6748 static const char path_win32
[] =
6749 "Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
6750 static const char path_win32_local
[] =
6751 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files|msitest|application_win32.txt";
6752 static const char path_win32_local_wow64
[] =
6753 "Software\\Microsoft\\Installer\\Win32Assemblies\\C:|Program Files (x86)|msitest|application_win32.txt";
6754 static const char name_dotnet
[] =
6755 "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6756 "version=\"1.0.0.0\",culture=\"neutral\"";
6757 static const char name_dotnet_local
[] =
6758 "Wine.Dotnet.Local.Assembly,processorArchitecture=\"MSIL\",publicKeyToken=\"abcdef0123456789\","
6759 "version=\"1.0.0.0\",culture=\"neutral\"";
6760 static const char name_win32
[] =
6761 "Wine.Win32.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6762 "type=\"win32\",version=\"1.0.0.0\"";
6763 static const char name_win32_local
[] =
6764 "Wine.Win32.Local.Assembly,processorArchitecture=\"x86\",publicKeyToken=\"abcdef0123456789\","
6765 "type=\"win32\",version=\"1.0.0.0\"";
6772 if (is_process_limited())
6774 skip("process is limited\n");
6778 create_test_files();
6779 create_file("msitest\\win32.txt", 1000);
6780 create_file("msitest\\win32_local.txt", 1000);
6781 create_file("msitest\\dotnet.txt", 1000);
6782 create_file("msitest\\dotnet_local.txt", 1000);
6783 create_file_data("msitest\\manifest.txt", manifest
, 0);
6784 create_file_data("msitest\\manifest_local.txt", manifest_local
, 0);
6785 create_file("msitest\\application_win32.txt", 1000);
6786 create_file("msitest\\application_dotnet.txt", 1000);
6787 create_database(msifile
, pa_tables
, sizeof(pa_tables
) / sizeof(msi_table
));
6789 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6791 r
= MsiInstallProductA(msifile
, NULL
);
6792 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6794 skip("Not enough rights to perform tests\n");
6797 if (r
== ERROR_INSTALL_FAILURE
)
6799 skip("No support for installing side-by-side assemblies\n");
6802 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6804 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6805 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6806 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6809 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6810 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6811 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6812 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6815 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6816 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6817 "Expected ERROR_SUCCESS, got %d\n", res
);
6818 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6821 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6822 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6823 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6824 "Expected ERROR_SUCCESS, got %d\n", res
);
6825 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6828 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6829 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6831 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_dotnet
, &hkey
);
6832 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6833 if (res
== ERROR_SUCCESS
)
6835 res
= RegDeleteValueA(hkey
, name_dotnet
);
6836 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6840 path
= (is_wow64
|| is_64bit
) ? path_dotnet_local_wow64
: path_dotnet_local
;
6841 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6842 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6844 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path_win32
, &hkey
);
6845 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6846 if (res
== ERROR_SUCCESS
)
6848 res
= RegDeleteValueA(hkey
, name_win32
);
6849 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6853 path
= (is_wow64
|| is_64bit
) ? path_win32_local_wow64
: path_win32_local
;
6854 res
= RegOpenKeyA(HKEY_CURRENT_USER
, path
, &hkey
);
6855 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6857 r
= MsiInstallProductA(msifile
, "ALLUSERS=1");
6858 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6860 access
= KEY_QUERY_VALUE
;
6861 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6862 if (res
== ERROR_FILE_NOT_FOUND
&& is_wow64
) /* Vista WOW64 */
6864 trace("Using 64-bit registry view for HKCR\\Installer\n");
6865 access
= KEY_QUERY_VALUE
| KEY_WOW64_64KEY
;
6866 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, 0, access
, &hkey
);
6868 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6869 CHECK_REG_STR(hkey
, name_dotnet
, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
6872 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6873 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6874 ok(res
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %d\n", res
);
6875 CHECK_REG_STR(hkey
, name_dotnet_local
, "rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox");
6878 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, classes_path_win32
, 0, access
, &hkey
);
6879 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6880 "Expected ERROR_SUCCESS, got %d\n", res
);
6881 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32
, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%");
6884 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6885 res
= RegOpenKeyExA(HKEY_CLASSES_ROOT
, path
, 0, access
, &hkey
);
6886 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
/* win2k without sxs support */,
6887 "Expected ERROR_SUCCESS, got %d\n", res
);
6888 if (res
== ERROR_SUCCESS
) CHECK_REG_STR(hkey
, name_win32_local
, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!");
6891 r
= MsiInstallProductA(msifile
, "REMOVE=ALL ALLUSERS=1");
6892 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6894 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_dotnet
, &hkey
);
6895 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6896 if (res
== ERROR_SUCCESS
)
6898 res
= RegDeleteValueA(hkey
, name_dotnet
);
6899 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6903 path
= (is_wow64
|| is_64bit
) ? classes_path_dotnet_local_wow64
: classes_path_dotnet_local
;
6904 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6905 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6907 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, classes_path_win32
, &hkey
);
6908 ok(res
== ERROR_SUCCESS
|| res
== ERROR_FILE_NOT_FOUND
, "got %d\n", res
);
6909 if (res
== ERROR_SUCCESS
)
6911 res
= RegDeleteValueA(hkey
, name_win32
);
6912 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6916 path
= (is_wow64
|| is_64bit
) ? classes_path_win32_local_wow64
: classes_path_win32_local
;
6917 res
= RegOpenKeyA(HKEY_CLASSES_ROOT
, path
, &hkey
);
6918 ok(res
== ERROR_FILE_NOT_FOUND
, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res
);
6921 DeleteFileA("msitest\\win32.txt");
6922 DeleteFileA("msitest\\win32_local.txt");
6923 DeleteFileA("msitest\\dotnet.txt");
6924 DeleteFileA("msitest\\dotnet_local.txt");
6925 DeleteFileA("msitest\\manifest.txt");
6926 DeleteFileA("msitest\\manifest_local.txt");
6927 DeleteFileA("msitest\\application_win32.txt");
6928 DeleteFileA("msitest\\application_dotnet.txt");
6929 delete_test_files();
6930 DeleteFileA(msifile
);
6933 static void test_remove_existing_products(void)
6937 if (is_process_limited())
6939 skip("process is limited\n");
6943 create_test_files();
6944 create_file("msitest\\rep.txt", 1000);
6945 create_database(msifile
, rep_tables
, sizeof(rep_tables
) / sizeof(msi_table
));
6947 MsiSetInternalUI(INSTALLUILEVEL_NONE
, NULL
);
6949 r
= MsiInstallProductA(msifile
, NULL
);
6950 if (r
== ERROR_INSTALL_PACKAGE_REJECTED
)
6952 skip("Not enough rights to perform tests\n");
6955 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6957 r
= MsiInstallProductA(msifile
, "REMOVE=ALL");
6958 ok(r
== ERROR_SUCCESS
, "Expected ERROR_SUCCESS, got %u\n", r
);
6960 ok(!delete_pf("msitest\\rep.txt", TRUE
), "file not removed\n");
6961 ok(!delete_pf("msitest", FALSE
), "directory not removed\n");
6964 DeleteFileA("msitest\\rep.txt");
6965 delete_test_files();
6966 DeleteFileA(msifile
);
6972 char temp_path
[MAX_PATH
], prev_path
[MAX_PATH
], log_file
[MAX_PATH
];
6973 STATEMGRSTATUS status
;
6976 init_functionpointers();
6978 if (pIsWow64Process
)
6979 pIsWow64Process(GetCurrentProcess(), &is_wow64
);
6981 GetCurrentDirectoryA(MAX_PATH
, prev_path
);
6982 GetTempPathA(MAX_PATH
, temp_path
);
6983 SetCurrentDirectoryA(temp_path
);
6985 lstrcpyA(CURR_DIR
, temp_path
);
6986 len
= lstrlenA(CURR_DIR
);
6988 if(len
&& (CURR_DIR
[len
- 1] == '\\'))
6989 CURR_DIR
[len
- 1] = 0;
6991 ok(get_system_dirs(), "failed to retrieve system dirs\n");
6992 ok(get_user_dirs(), "failed to retrieve user dirs\n");
6994 /* Create a restore point ourselves so we circumvent the multitude of restore points
6995 * that would have been created by all the installation and removal tests.
6997 * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
6998 * creation of restore points.
7000 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
)
7002 memset(&status
, 0, sizeof(status
));
7003 ret
= notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE
, &status
);
7006 /* Create only one log file and don't append. We have to pass something
7007 * for the log mode for this to work. The logfile needs to have an absolute
7008 * path otherwise we still end up with some extra logfiles as some tests
7009 * change the current directory.
7011 lstrcpyA(log_file
, temp_path
);
7012 lstrcatA(log_file
, "\\msitest.log");
7013 MsiEnableLogA(INSTALLLOGMODE_FATALEXIT
, log_file
, 0);
7015 test_register_product();
7016 test_publish_product();
7017 test_publish_features();
7018 test_register_user();
7019 test_process_components();
7021 test_publish_sourcelist();
7022 test_remove_files();
7024 test_duplicate_files();
7025 test_write_registry_values();
7027 test_create_remove_folder();
7028 test_start_stop_services();
7029 test_delete_services();
7030 test_install_services();
7031 test_self_registration();
7032 test_register_font();
7033 test_validate_product_id();
7034 test_install_remove_odbc();
7035 test_register_typelib();
7036 test_create_remove_shortcut();
7037 test_publish_components();
7038 test_remove_duplicate_files();
7039 test_remove_registry_values();
7040 test_find_related_products();
7041 test_remove_ini_values();
7042 test_remove_env_strings();
7043 test_register_class_info();
7044 test_register_extension_info();
7045 test_register_progid_info();
7046 test_register_mime_info();
7047 test_publish_assemblies();
7048 test_remove_existing_products();
7050 DeleteFileA(log_file
);
7052 if (pSRSetRestorePointA
&& !pMsiGetComponentPathExA
&& ret
)
7054 ret
= notify_system_change(END_NESTED_SYSTEM_CHANGE
, &status
);
7056 remove_restore_point(status
.llSequenceNumber
);
7058 FreeLibrary(hsrclient
);
7060 SetCurrentDirectoryA(prev_path
);