ReactOS 0.4.16-dev-303-g11d5cb8
package.c
Go to the documentation of this file.
1/*
2 * Implementation of the Microsoft Installer (msi.dll)
3 *
4 * Copyright 2004 Aric Stewart for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#define COBJMACROS
22
23#ifdef __REACTOS__
24#define WIN32_NO_STATUS
25#endif
26
27#include <stdarg.h>
28#include "windef.h"
29#include "winbase.h"
30#include "winreg.h"
31#include "winnls.h"
32#ifdef __REACTOS__
33#include <ndk/rtlfuncs.h>
34#else
35#include "winternl.h"
36#endif
37#include "shlwapi.h"
38#include "wingdi.h"
39#include "msi.h"
40#include "msiquery.h"
41#include "objidl.h"
42#include "wincrypt.h"
43#include "winuser.h"
44#include "wininet.h"
45#include "winver.h"
46#include "urlmon.h"
47#include "shlobj.h"
48#include "objbase.h"
49#include "msidefs.h"
50#include "sddl.h"
51
52#include "wine/debug.h"
53#include "wine/exception.h"
54
55#include "msipriv.h"
56#include "winemsi_s.h"
57#include "resource.h"
58
60
62{
63 struct list *item, *cursor;
64
66 {
68 list_remove( &fl->entry );
69 free( fl );
70 }
71
72 LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
73 {
75 list_remove( &cl->entry );
76 free( cl );
77 }
78 free( feature->Feature );
79 free( feature->Feature_Parent );
80 free( feature->Directory );
81 free( feature->Description );
82 free( feature->Title );
83 free( feature );
84}
85
87{
88 struct list *item, *cursor;
89
90 LIST_FOR_EACH_SAFE( item, cursor, &folder->children )
91 {
93 list_remove( &fl->entry );
94 free( fl );
95 }
96 free( folder->Parent );
97 free( folder->Directory );
98 free( folder->TargetDefault );
99 free( folder->SourceLongPath );
100 free( folder->SourceShortPath );
101 free( folder->ResolvedTarget );
102 free( folder->ResolvedSource );
103 free( folder );
104}
105
107{
108 struct list *item, *cursor;
109
110 LIST_FOR_EACH_SAFE( item, cursor, &ext->verbs )
111 {
112 MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
113
114 list_remove( &verb->entry );
115 free( verb->Verb );
116 free( verb->Command );
117 free( verb->Argument );
118 free( verb );
119 }
120
121 free( ext->Extension );
122 free( ext->ProgIDText );
123 free( ext );
124}
125
127{
128 free( assembly->feature );
130 free( assembly->application );
131 free( assembly->display_name );
132 if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
133 free( assembly->tempdir );
134 free( assembly );
135}
136
138{
139 UINT i;
140 for (i = 0; i < package->script_actions_count[script]; i++)
141 free( package->script_actions[script][i] );
142
143 free( package->script_actions[script] );
144 package->script_actions[script] = NULL;
145 package->script_actions_count[script] = 0;
146}
147
148static void free_package_structures( MSIPACKAGE *package )
149{
150 struct list *item, *cursor;
151 int i;
152
154 {
156 list_remove( &feature->entry );
158 }
159
161 {
165 }
166
167 LIST_FOR_EACH_SAFE( item, cursor, &package->files )
168 {
170
172 free( file->File );
173 free( file->FileName );
174 free( file->ShortName );
175 free( file->LongName );
176 free( file->Version );
177 free( file->Language );
178 if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
179 free( file->TargetPath );
180 free( file );
181 }
182
184 {
186
187 list_remove( &comp->entry );
188 free( comp->Component );
189 free( comp->ComponentId );
190 free( comp->Directory );
191 free( comp->Condition );
192 free( comp->KeyPath );
193 free( comp->FullKeypath );
194 if (comp->assembly) free_assembly( comp->assembly );
195 free( comp );
196 }
197
199 {
201
202 list_remove( &patch->entry );
203 free( patch->path );
204 free( patch );
205 }
206
207 /* clean up extension, progid, class and verb structures */
209 {
211
212 list_remove( &cls->entry );
213 free( cls->clsid );
214 free( cls->Context );
215 free( cls->Description );
216 free( cls->FileTypeMask );
217 free( cls->IconPath );
218 free( cls->DefInprocHandler );
219 free( cls->DefInprocHandler32 );
220 free( cls->Argument );
221 free( cls->ProgIDText );
222 free( cls );
223 }
224
226 {
228
229 list_remove( &ext->entry );
231 }
232
234 {
236
237 list_remove( &progid->entry );
238 free( progid->ProgID );
239 free( progid->Description );
240 free( progid->IconPath );
241 free( progid );
242 }
243
244 LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
245 {
247
248 list_remove( &mt->entry );
249 free( mt->suffix );
250 free( mt->clsid );
251 free( mt->ContentType );
252 free( mt );
253 }
254
255 LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
256 {
258
259 list_remove( &appid->entry );
260 free( appid->AppID );
261 free( appid->RemoteServerName );
262 free( appid->LocalServer );
263 free( appid->ServiceParameters );
264 free( appid->DllSurrogate );
265 free( appid );
266 }
267
269 {
271
272 list_remove( &info->entry );
273 free( info->value );
274 free( info );
275 }
276
278 {
280
281 list_remove( &info->entry );
282 free( info->volume_label );
283 free( info->disk_prompt );
284 free( info );
285 }
286
287 for (i = 0; i < SCRIPT_MAX; i++)
288 msi_free_action_script( package, i );
289
290 for (i = 0; i < package->unique_actions_count; i++)
291 free( package->unique_actions[i] );
292 free( package->unique_actions );
293
295 {
297
298 list_remove( &binary->entry );
299 if (!DeleteFileW( binary->tmpfile ))
300 ERR( "failed to delete %s (%lu)\n", debugstr_w(binary->tmpfile), GetLastError() );
301 free( binary->source );
302 free( binary->tmpfile );
303 free( binary );
304 }
305
307 {
309
310 list_remove( &cab->entry );
311 IStorage_Release( cab->storage );
312 free( cab->stream );
313 free( cab );
314 }
315
317 {
319
320 list_remove( &patch->entry );
321 if (patch->delete_on_close && !DeleteFileW( patch->localfile ))
322 {
323 ERR( "failed to delete %s (%lu)\n", debugstr_w(patch->localfile), GetLastError() );
324 }
325 msi_free_patchinfo( patch );
326 }
327
328 free( package->PackagePath );
329 free( package->ProductCode );
330 free( package->ActionFormat );
331 free( package->LastAction );
332 free( package->LastActionTemplate );
333 free( package->langids );
334
335 /* cleanup control event subscriptions */
337}
338
340{
341 MSIPACKAGE *package = (MSIPACKAGE *)arg;
342
344
345 if( package->dialog )
346 msi_dialog_destroy( package->dialog );
347
348 msiobj_release( &package->db->hdr );
350 CloseHandle( package->log_file );
351 if (package->rpc_server_started)
352 RpcServerUnregisterIf(s_IWineMsiRemote_v0_0_s_ifspec, NULL, FALSE);
353 if (rpc_handle)
354 RpcBindingFree(&rpc_handle);
355 if (package->custom_server_32_process)
356 custom_stop_server(package->custom_server_32_process, package->custom_server_32_pipe);
357 if (package->custom_server_64_process)
358 custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe);
359
360 if (package->delete_on_close) DeleteFileW( package->localfile );
361 free( package->localfile );
363}
364
366{
367 MSIQUERY *view;
368 UINT rc;
369
370 rc = MSI_DatabaseOpenViewW(package->db, L"CREATE TABLE `_Property` ( `_Property` CHAR(56) NOT NULL TEMPORARY, "
371 L"`Value` CHAR(98) NOT NULL TEMPORARY PRIMARY KEY `_Property`) HOLD", &view);
372 if (rc != ERROR_SUCCESS)
373 return rc;
374
375 rc = MSI_ViewExecute(view, 0);
377 msiobj_release(&view->hdr);
378 return rc;
379}
380
382{
383 MSIQUERY *view_select;
384 UINT rc;
385
386 rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
387 if (rc != ERROR_SUCCESS)
388 return rc;
389
390 rc = MSI_ViewExecute( view_select, 0 );
391 if (rc != ERROR_SUCCESS)
392 {
393 MSI_ViewClose( view_select );
394 msiobj_release( &view_select->hdr );
395 return rc;
396 }
397
398 while (1)
399 {
400 MSIQUERY *view_insert, *view_update;
401 MSIRECORD *rec_select;
402
403 rc = MSI_ViewFetch( view_select, &rec_select );
404 if (rc != ERROR_SUCCESS)
405 break;
406
407 rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
408 if (rc != ERROR_SUCCESS)
409 {
410 msiobj_release( &rec_select->hdr );
411 continue;
412 }
413
414 rc = MSI_ViewExecute( view_insert, rec_select );
415 MSI_ViewClose( view_insert );
416 msiobj_release( &view_insert->hdr );
417 if (rc != ERROR_SUCCESS)
418 {
419 MSIRECORD *rec_update;
420
421 TRACE("insert failed, trying update\n");
422
423 rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
424 if (rc != ERROR_SUCCESS)
425 {
426 WARN("open view failed %u\n", rc);
427 msiobj_release( &rec_select->hdr );
428 continue;
429 }
430
431 rec_update = MSI_CreateRecord( 2 );
432 MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
433 MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
434 rc = MSI_ViewExecute( view_update, rec_update );
435 if (rc != ERROR_SUCCESS)
436 WARN("update failed %u\n", rc);
437
438 MSI_ViewClose( view_update );
439 msiobj_release( &view_update->hdr );
440 msiobj_release( &rec_update->hdr );
441 }
442
443 msiobj_release( &rec_select->hdr );
444 }
445
446 MSI_ViewClose( view_select );
447 msiobj_release( &view_select->hdr );
448 return rc;
449}
450
451/*
452 * set_installed_prop
453 *
454 * Sets the "Installed" property to indicate that
455 * the product is installed for the current user.
456 */
458{
459 HKEY hkey;
460 UINT r;
461
462 if (!package->ProductCode) return ERROR_FUNCTION_FAILED;
463
464 r = MSIREG_OpenUninstallKey( package->ProductCode, package->platform, &hkey, FALSE );
465 if (r == ERROR_SUCCESS)
466 {
467 RegCloseKey( hkey );
468 msi_set_property( package->db, L"Installed", L"1", -1 );
469 }
470 return r;
471}
472
474{
475 SID_NAME_USE use;
477 LPWSTR sid_str = NULL, dom = NULL;
478 DWORD size, dom_size;
479 PSID psid = NULL;
481
482 size = 0;
484
485 user_name = malloc( (size + 1) * sizeof(WCHAR) );
486 if (!user_name)
487 return ERROR_OUTOFMEMORY;
488
489 if (!GetUserNameW( user_name, &size ))
490 goto done;
491
492 size = 0;
493 dom_size = 0;
494 LookupAccountNameW( NULL, user_name, NULL, &size, NULL, &dom_size, &use );
495
496 psid = malloc( size );
497 dom = malloc( dom_size * sizeof (WCHAR) );
498 if (!psid || !dom)
499 {
501 goto done;
502 }
503
504 if (!LookupAccountNameW( NULL, user_name, psid, &size, dom, &dom_size, &use ))
505 goto done;
506
507 if (!ConvertSidToStringSidW( psid, &sid_str ))
508 goto done;
509
510 r = msi_set_property( package->db, L"UserSID", sid_str, -1 );
511
512done:
513 LocalFree( sid_str );
514 free( dom );
515 free( psid );
516 free( user_name );
517
518 return r;
519}
520
522{
523 HKEY netsetup, hkey;
524 LONG res;
525 DWORD size, len, type;
526 WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
527
528 res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\NET Framework Setup\\NDP", 0, KEY_CREATE_SUB_KEY,
529 &netsetup);
530 if (res != ERROR_SUCCESS)
531 return NULL;
532
533 if (!RegCreateKeyExW(netsetup, L"v4\\Client", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
534 {
535 size = sizeof(path);
536 if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
537 {
538 len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
539 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
540
542 lstrcatW(filename, L"\\");
543 lstrcatW(filename, L"fusion.dll");
545 {
546 TRACE( "found %s\n", debugstr_w(filename) );
547 RegCloseKey(hkey);
548 RegCloseKey(netsetup);
549 return filename;
550 }
551 }
552 RegCloseKey(hkey);
553 }
554
555 if (!RegCreateKeyExW(netsetup, L"v2.0.50727", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
556 {
557 RegCloseKey(hkey);
559 len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
560 lstrlenW(L"fusion.dll") + 3;
561 free(filename);
562 if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
563
564 lstrcpyW(filename, windir);
565 lstrcatW(filename, L"\\");
566 lstrcatW(filename, L"Microsoft.NET\\Framework\\");
567 lstrcatW(filename, L"v2.0.50727");
568 lstrcatW(filename, L"\\");
569 lstrcatW(filename, L"fusion.dll");
571 {
572 TRACE( "found %s\n", debugstr_w(filename) );
573 RegCloseKey(netsetup);
574 return filename;
575 }
576 }
577
578 RegCloseKey(netsetup);
579 return filename;
580}
581
583{
586};
587
589{
590 UINT val_len;
594 LPWSTR fusion, verstr;
595 struct lang_codepage *translate;
596
597 fusion = get_fusion_filename(package);
598 if (!fusion)
599 return;
600
602 if (!size)
603 goto done;
604
606 if (!version)
607 goto done;
608
609 if (!GetFileVersionInfoW(fusion, handle, size, version))
610 goto done;
611
612 if (!VerQueryValueW(version, L"\\VarFileInfo\\Translation", (LPVOID *)&translate, &val_len))
613 goto done;
614
615 swprintf(buf, ARRAY_SIZE(buf), L"\\StringFileInfo\\%04x%04x\\ProductVersion", translate[0].wLanguage,
617
618 if (!VerQueryValueW(version, buf, (LPVOID *)&verstr, &val_len))
619 goto done;
620
621 if (!val_len || !verstr)
622 goto done;
623
624 msi_set_property( package->db, L"MsiNetAssemblySupport", verstr, -1 );
625
626done:
627 free(fusion);
628 free(version);
629}
630
632{
633 WCHAR *ptr;
634 RTL_OSVERSIONINFOEXW OSVersion;
635 MEMORYSTATUSEX msex;
636 DWORD verval, len, type;
637 WCHAR pth[MAX_PATH], verstr[11], bufstr[22];
638 HDC dc;
639 HKEY hkey;
640 LPWSTR username, companyname;
641 SYSTEM_INFO sys_info;
643
644 /*
645 * Other things that probably should be set:
646 *
647 * VirtualMemory ShellAdvSupport DefaultUIFont PackagecodeChanging
648 * CaptionHeight BorderTop BorderSide TextHeight RedirectedDllSupport
649 */
650
652 lstrcatW(pth, L"\\");
653 msi_set_property( package->db, L"CommonAppDataFolder", pth, -1 );
654
656 lstrcatW(pth, L"\\");
657 msi_set_property( package->db, L"FavoritesFolder", pth, -1 );
658
660 lstrcatW(pth, L"\\");
661 msi_set_property( package->db, L"FontsFolder", pth, -1 );
662
664 lstrcatW(pth, L"\\");
665 msi_set_property( package->db, L"SendToFolder", pth, -1 );
666
668 lstrcatW(pth, L"\\");
669 msi_set_property( package->db, L"StartMenuFolder", pth, -1 );
670
672 lstrcatW(pth, L"\\");
673 msi_set_property( package->db, L"StartupFolder", pth, -1 );
674
676 lstrcatW(pth, L"\\");
677 msi_set_property( package->db, L"TemplateFolder", pth, -1 );
678
680 lstrcatW(pth, L"\\");
681 msi_set_property( package->db, L"DesktopFolder", pth, -1 );
682
683 /* FIXME: set to AllUsers profile path if ALLUSERS is set */
685 lstrcatW(pth, L"\\");
686 msi_set_property( package->db, L"ProgramMenuFolder", pth, -1 );
687
689 lstrcatW(pth, L"\\");
690 msi_set_property( package->db, L"AdminToolsFolder", pth, -1 );
691
693 lstrcatW(pth, L"\\");
694 msi_set_property( package->db, L"AppDataFolder", pth, -1 );
695
697 lstrcatW(pth, L"\\");
698 msi_set_property( package->db, L"SystemFolder", pth, -1 );
699 msi_set_property( package->db, L"System16Folder", pth, -1 );
700
702 lstrcatW(pth, L"\\");
703 msi_set_property( package->db, L"LocalAppDataFolder", pth, -1 );
704
706 lstrcatW(pth, L"\\");
707 msi_set_property( package->db, L"MyPicturesFolder", pth, -1 );
708
710 lstrcatW(pth, L"\\");
711 msi_set_property( package->db, L"PersonalFolder", pth, -1 );
712
714 lstrcatW(pth, L"\\");
715 msi_set_property( package->db, L"WindowsFolder", pth, -1 );
716
718 lstrcatW(pth, L"\\");
719 msi_set_property( package->db, L"PrintHoodFolder", pth, -1 );
720
722 lstrcatW(pth, L"\\");
723 msi_set_property( package->db, L"NetHoodFolder", pth, -1 );
724
726 lstrcatW(pth, L"\\");
727 msi_set_property( package->db, L"RecentFolder", pth, -1 );
728
729 /* Physical Memory is specified in MB. Using total amount. */
730 msex.dwLength = sizeof(msex);
731 GlobalMemoryStatusEx( &msex );
732 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", (int)(msex.ullTotalPhys / 1024 / 1024) );
733 msi_set_property( package->db, L"PhysicalMemory", bufstr, len );
734
736 ptr = wcschr(pth,'\\');
737 if (ptr) *(ptr + 1) = 0;
738 msi_set_property( package->db, L"WindowsVolume", pth, -1 );
739
740 len = GetTempPathW(MAX_PATH, pth);
741 msi_set_property( package->db, L"TempFolder", pth, len );
742
743 /* in a wine environment the user is always admin and privileged */
744 msi_set_property( package->db, L"AdminUser", L"1", -1 );
745 msi_set_property( package->db, L"Privileged", L"1", -1 );
746 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
747
748 /* set the os things */
749 OSVersion.dwOSVersionInfoSize = sizeof(OSVersion);
751 verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
752 if (verval > 603)
753 {
754 verval = 603;
755 OSVersion.dwBuildNumber = 9600;
756 }
757 len = swprintf( verstr, ARRAY_SIZE(verstr), L"%u", verval );
758 switch (OSVersion.dwPlatformId)
759 {
761 msi_set_property( package->db, L"Version9X", verstr, len );
762 break;
764 msi_set_property( package->db, L"VersionNT", verstr, len );
765 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wProductType );
766 msi_set_property( package->db, L"MsiNTProductType", bufstr, len );
767 break;
768 }
769 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.dwBuildNumber );
770 msi_set_property( package->db, L"WindowsBuild", bufstr, len );
771 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wServicePackMajor );
772 msi_set_property( package->db, L"ServicePackLevel", bufstr, len );
773
774 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u.%u", MSI_MAJORVERSION, MSI_MINORVERSION );
775 msi_set_property( package->db, L"VersionMsi", bufstr, len );
776 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", MSI_MAJORVERSION * 100 );
777 msi_set_property( package->db, L"VersionDatabase", bufstr, len );
778
779 RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0,
781
782 GetNativeSystemInfo( &sys_info );
783 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", sys_info.wProcessorLevel );
784 msi_set_property( package->db, L"Intel", bufstr, len );
786 {
788 PathAddBackslashW( pth );
789 msi_set_property( package->db, L"SystemFolder", pth, -1 );
790
791 len = sizeof(pth);
792 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
793 PathAddBackslashW( pth );
794 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
795
796 len = sizeof(pth);
797 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
798 PathAddBackslashW( pth );
799 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
800 }
802 {
803 msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
804 msi_set_property( package->db, L"Msix64", bufstr, -1 );
805 msi_set_property( package->db, L"VersionNT64", verstr, -1 );
806
808 PathAddBackslashW( pth );
809 msi_set_property( package->db, L"System64Folder", pth, -1 );
810
812 PathAddBackslashW( pth );
813 msi_set_property( package->db, L"SystemFolder", pth, -1 );
814
815 len = sizeof(pth);
816 RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
817 PathAddBackslashW( pth );
818 msi_set_property( package->db, L"ProgramFiles64Folder", pth, -1 );
819
820 len = sizeof(pth);
821 RegQueryValueExW(hkey, L"ProgramFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
822 PathAddBackslashW( pth );
823 msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
824
825 len = sizeof(pth);
826 RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
827 PathAddBackslashW( pth );
828 msi_set_property( package->db, L"CommonFiles64Folder", pth, -1 );
829
830 len = sizeof(pth);
831 RegQueryValueExW(hkey, L"CommonFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
832 PathAddBackslashW( pth );
833 msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
834 }
835
836 RegCloseKey(hkey);
837
838 /* Screen properties. */
839 dc = GetDC(0);
840 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, HORZRES) );
841 msi_set_property( package->db, L"ScreenX", bufstr, len );
842 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, VERTRES) );
843 msi_set_property( package->db, L"ScreenY", bufstr, len );
844 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, BITSPIXEL) );
845 msi_set_property( package->db, L"ColorBits", bufstr, len );
846 ReleaseDC(0, dc);
847
848 /* USERNAME and COMPANYNAME */
849 username = msi_dup_property( package->db, L"USERNAME" );
850 companyname = msi_dup_property( package->db, L"COMPANYNAME" );
851
852 if ((!username || !companyname) &&
853 RegOpenKeyW( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey ) == ERROR_SUCCESS)
854 {
855 if (!username &&
856 (username = msi_reg_get_val_str( hkey, L"DefName" )))
857 msi_set_property( package->db, L"USERNAME", username, -1 );
858 if (!companyname &&
859 (companyname = msi_reg_get_val_str( hkey, L"DefCompany" )))
860 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
861 CloseHandle( hkey );
862 }
863 if ((!username || !companyname) &&
864 RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0,
866 {
867 if (!username &&
868 (username = msi_reg_get_val_str( hkey, L"RegisteredOwner" )))
869 msi_set_property( package->db, L"USERNAME", username, -1 );
870 if (!companyname &&
871 (companyname = msi_reg_get_val_str( hkey, L"RegisteredOrganization" )))
872 msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
873 CloseHandle( hkey );
874 }
875 free( username );
876 free( companyname );
877
878 if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
879 ERR("Failed to set the UserSID property\n");
880
881 set_msi_assembly_prop( package );
882
884 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
885 msi_set_property( package->db, L"UserLanguageID", bufstr, len );
886
888 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
889 msi_set_property( package->db, L"SystemLanguageID", bufstr, len );
890
891 len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", MsiQueryProductStateW(package->ProductCode) );
892 msi_set_property( package->db, L"ProductState", bufstr, len );
893
894 len = 0;
896 {
898 if ((username = malloc( len * sizeof(WCHAR) )))
899 {
900 if (GetUserNameW( username, &len ))
901 msi_set_property( package->db, L"LogonUser", username, len - 1 );
902 free( username );
903 }
904 }
905 len = 0;
907 {
908 WCHAR *computername;
909 if ((computername = malloc( len * sizeof(WCHAR) )))
910 {
911 if (GetComputerNameW( computername, &len ))
912 msi_set_property( package->db, L"ComputerName", computername, len );
913 free( computername );
914 }
915 }
916}
917
919{
920 MSIPACKAGE *package;
921
922 package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE),
923 MSI_FreePackage );
924 if( package )
925 {
926 list_init( &package->components );
927 list_init( &package->features );
928 list_init( &package->files );
929 list_init( &package->filepatches );
930 list_init( &package->tempfiles );
931 list_init( &package->folders );
932 list_init( &package->subscriptions );
933 list_init( &package->appids );
934 list_init( &package->classes );
935 list_init( &package->mimes );
936 list_init( &package->extensions );
937 list_init( &package->progids );
938 list_init( &package->RunningActions );
939 list_init( &package->sourcelist_info );
940 list_init( &package->sourcelist_media );
941 list_init( &package->patches );
942 list_init( &package->binaries );
943 list_init( &package->cabinet_streams );
944 }
945
946 return package;
947}
948
950{
951 BYTE *data;
952 UINT r, sz;
953
954 r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
955 if (r != ERROR_SUCCESS)
956 return r;
957
958 r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
959
960 free(data);
961 return r;
962}
963
965{
966 /* FIXME: this should depend on the user's privileges */
967 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
968 {
969 TRACE("resetting ALLUSERS property from 2 to 1\n");
970 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
971 }
972 msi_set_property( package->db, L"AdminUser", L"1", -1 );
973 msi_set_property( package->db, L"Privileged", L"1", -1 );
974 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
975}
976
978{
979 MSIPACKAGE *package;
980 WCHAR uilevel[11];
981 int len;
982 UINT r;
983
984 TRACE("%p\n", db);
985
986 package = alloc_package();
987 if (package)
988 {
989 msiobj_addref( &db->hdr );
990 package->db = db;
991
992 package->LastAction = NULL;
993 package->LastActionTemplate = NULL;
995 package->WordCount = 0;
996 package->PackagePath = wcsdup( db->path );
997
999 msi_clone_properties( package->db );
1001
1002 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1003
1004 set_installer_properties( package );
1005
1006 package->ui_level = gUILevel;
1007 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1008 msi_set_property( package->db, L"UILevel", uilevel, len );
1009
1010 r = msi_load_suminfo_properties( package );
1011 if (r != ERROR_SUCCESS)
1012 {
1013 msiobj_release( &package->hdr );
1014 return NULL;
1015 }
1016
1018 load_admin_properties( package );
1019
1020 package->log_file = INVALID_HANDLE_VALUE;
1021 package->script = SCRIPT_NONE;
1022 }
1023 return package;
1024}
1025
1027{
1029 DWORD size = 0;
1030 HRESULT hr;
1031
1032 /* call will always fail, because size is 0,
1033 * but will return ERROR_FILE_NOT_FOUND first
1034 * if the file doesn't exist
1035 */
1036 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1038 {
1039 cache_entry = malloc( size );
1040 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1041 {
1043 free( cache_entry );
1044 return error;
1045 }
1046
1047 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1048 free( cache_entry );
1049 return ERROR_SUCCESS;
1050 }
1051
1053 if ( FAILED(hr) )
1054 {
1055 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1056 return ERROR_FUNCTION_FAILED;
1057 }
1058
1059 return ERROR_SUCCESS;
1060}
1061
1063{
1064 DWORD time, len, i, offset;
1065 HANDLE handle;
1066
1067 time = GetTickCount();
1069 lstrcatW( path, L"\\Installer\\" );
1071
1072 len = lstrlenW(path);
1073 for (i = 0; i < 0x10000; i++)
1074 {
1075 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1076 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1080 {
1082 break;
1083 }
1086 return ERROR_FUNCTION_FAILED;
1087 }
1088
1089 return ERROR_SUCCESS;
1090}
1091
1092static enum platform parse_platform( const WCHAR *str )
1093{
1094 if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
1095 else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
1096 else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
1097 else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
1098 else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
1099 return PLATFORM_UNRECOGNIZED;
1100}
1101
1103{
1104 WCHAR *template, *p, *q, *platform;
1105 DWORD i, count;
1106
1108 TRACE("version: %d\n", package->version);
1109
1110 template = msi_suminfo_dup_string( si, PID_TEMPLATE );
1111 if (!template)
1112 return ERROR_SUCCESS; /* native accepts missing template property */
1113
1114 TRACE("template: %s\n", debugstr_w(template));
1115
1116 p = wcschr( template, ';' );
1117 if (!p)
1118 {
1119 WARN("invalid template string %s\n", debugstr_w(template));
1120 free( template );
1122 }
1123 *p = 0;
1124 platform = template;
1125 if ((q = wcschr( platform, ',' ))) *q = 0;
1126 package->platform = parse_platform( platform );
1127 while (package->platform == PLATFORM_UNRECOGNIZED && q)
1128 {
1129 platform = q + 1;
1130 if ((q = wcschr( platform, ',' ))) *q = 0;
1131 package->platform = parse_platform( platform );
1132 }
1133 if (package->platform == PLATFORM_UNRECOGNIZED)
1134 {
1135 WARN("unknown platform %s\n", debugstr_w(template));
1136 free( template );
1138 }
1139 p++;
1140 if (!*p)
1141 {
1142 free( template );
1143 return ERROR_SUCCESS;
1144 }
1145 count = 1;
1146 for (q = p; (q = wcschr( q, ',' )); q++) count++;
1147
1148 package->langids = malloc( count * sizeof(LANGID) );
1149 if (!package->langids)
1150 {
1151 free( template );
1152 return ERROR_OUTOFMEMORY;
1153 }
1154
1155 i = 0;
1156 while (*p)
1157 {
1158 q = wcschr( p, ',' );
1159 if (q) *q = 0;
1160 package->langids[i] = wcstol( p, NULL, 10 );
1161 if (!q) break;
1162 p = q + 1;
1163 i++;
1164 }
1165 package->num_langids = i + 1;
1166
1167 free( template );
1168 return ERROR_SUCCESS;
1169}
1170
1172{
1173 UINT i;
1174
1175 if (package->platform == PLATFORM_INTEL64)
1177#ifndef __arm__
1178 if (package->platform == PLATFORM_ARM)
1180#endif
1181#ifndef __aarch64__
1182 if (package->platform == PLATFORM_ARM64)
1184#endif
1185 if (package->platform == PLATFORM_X64)
1186 {
1187 if (!is_64bit && !is_wow64)
1189 if (package->version < 200)
1191 }
1192 if (!package->num_langids)
1193 {
1194 return ERROR_SUCCESS;
1195 }
1196 for (i = 0; i < package->num_langids; i++)
1197 {
1198 LANGID langid = package->langids[i];
1199
1201 {
1203 }
1205 {
1207 }
1209 return ERROR_SUCCESS;
1210 }
1212}
1213
1214static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop )
1215{
1217 MSIQUERY *view;
1218 MSIRECORD *rec;
1219 WCHAR *ret = NULL;
1220
1221 swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
1223 {
1224 return NULL;
1225 }
1226 if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
1227 {
1229 msiobj_release( &view->hdr );
1230 return NULL;
1231 }
1232 if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
1233 {
1234 ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
1235 msiobj_release( &rec->hdr );
1236 }
1238 msiobj_release( &view->hdr );
1239 return ret;
1240}
1241
1243{
1244 return get_property( db, L"ProductCode" );
1245}
1246
1248{
1249 return get_property( db, L"ProductVersion" );
1250}
1251
1252static UINT get_registered_local_package( const WCHAR *product, WCHAR *localfile )
1253{
1255 WCHAR *filename;
1256 HKEY props_key;
1257 UINT r;
1258
1259 r = msi_locate_product( product, &context );
1260 if (r != ERROR_SUCCESS)
1261 return r;
1262
1263 r = MSIREG_OpenInstallProps( product, context, NULL, &props_key, FALSE );
1264 if (r != ERROR_SUCCESS)
1265 return r;
1266
1268 RegCloseKey( props_key );
1269 if (!filename)
1270 return ERROR_FUNCTION_FAILED;
1271
1272 lstrcpyW( localfile, filename );
1273 free( filename );
1274 return ERROR_SUCCESS;
1275}
1276
1278{
1279 WCHAR *ret;
1280 MSISUMMARYINFO *si;
1281 UINT r;
1282
1283 r = msi_get_suminfo( db->storage, 0, &si );
1284 if (r != ERROR_SUCCESS)
1285 {
1286 r = msi_get_db_suminfo( db, 0, &si );
1287 if (r != ERROR_SUCCESS)
1288 {
1289 WARN("failed to load summary info %u\n", r);
1290 return NULL;
1291 }
1292 }
1294 msiobj_release( &si->hdr );
1295 return ret;
1296}
1297
1298static UINT get_local_package( MSIDATABASE *db, WCHAR *localfile )
1299{
1300 WCHAR *product_code;
1301 UINT r;
1302
1303 if (!(product_code = get_product_code( db )))
1305 r = get_registered_local_package( product_code, localfile );
1306 free( product_code );
1307 return r;
1308}
1309
1311{
1312 UINT r;
1313
1314 if (UrlIsW( package, URLIS_URL ))
1315 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1316 else if (package[0] == '#')
1317 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1318 else
1319 {
1320 DWORD len;
1321 WCHAR *path;
1322
1323 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1324 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1325 len = GetFullPathNameW( package, len, path, NULL );
1326 r = msi_set_property( db, L"OriginalDatabase", path, len );
1327 free( path );
1328 }
1329 return r;
1330}
1331
1332#ifdef __REACTOS__
1335BOOL WINAPI SE_DynamicShim(LPCWSTR ProcessImage, PVOID hsdb, PVOID pQueryResult, LPCSTR Module, LPDWORD lpdwDynamicToken);
1338
1339#define HID_DOS_PATHS 0x1
1340#define SDB_DATABASE_MAIN_SHIM 0x80030000
1341
1342#define APPHELP_VALID_RESULT 0x10000
1343#define APPHELP_RESULT_FOUND 0x40000
1344
1345static void
1346AppHelpCheckPackage(LPCWSTR szPackage)
1347{
1348 USHORT ExeType = 0;
1349 ULONG Reason = 0;
1350
1351 PVOID QueryResult = NULL;
1352 ULONG QueryResultSize = 0;
1353
1354 HANDLE Handle = NULL;
1355 BOOL Continue = ApphelpCheckRunAppEx(
1356 Handle, NULL, NULL, szPackage, NULL, ExeType, &Reason, &QueryResult, &QueryResultSize, NULL,
1357 NULL, NULL, NULL, NULL);
1358
1359 if (Continue)
1360 {
1362 {
1363 DWORD dwToken;
1365 if (hsdb)
1366 {
1367 BOOL bShim = SE_DynamicShim(szPackage, hsdb, QueryResult, "msi.dll", &dwToken);
1368 ERR("ReactOS HACK(CORE-13283): Used SE_DynamicShim %d!\n", bShim);
1369
1370 SdbReleaseDatabase(hsdb);
1371 }
1372 else
1373 {
1374 ERR("Unable to open SDB_DATABASE_MAIN_SHIM\n");
1375 }
1376 }
1377 }
1378
1379 if (QueryResult)
1380 RtlFreeHeap(RtlGetProcessHeap(), 0, QueryResult);
1381}
1382#endif
1383
1385{
1386 MSIDATABASE *db;
1387 MSIPACKAGE *package;
1389 MSIRECORD *data_row, *info_row;
1390 UINT r;
1391 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1392 LPCWSTR file = szPackage;
1393 DWORD index = 0;
1394 MSISUMMARYINFO *si;
1395 BOOL delete_on_close = FALSE;
1396 WCHAR *info_template, *productname, *product_code;
1398
1399 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1400
1402
1403 localfile[0] = 0;
1404 if( szPackage[0] == '#' )
1405 {
1406 handle = wcstol(&szPackage[1], NULL, 10);
1408 return ERROR_INVALID_HANDLE;
1409 }
1410 else
1411 {
1412 WCHAR *product_version = NULL;
1413
1414 if ( UrlIsW( szPackage, URLIS_URL ) )
1415 {
1416 r = msi_download_file( szPackage, cachefile );
1417 if (r != ERROR_SUCCESS)
1418 return r;
1419
1420 file = cachefile;
1421 }
1422#ifdef __REACTOS__
1423 AppHelpCheckPackage(file);
1424#endif
1425
1427 if (r != ERROR_SUCCESS)
1428 {
1430 return ERROR_FILE_NOT_FOUND;
1431 return r;
1432 }
1433 r = get_local_package( db, localfile );
1435 {
1436 DWORD localfile_attr;
1437
1438 r = msi_create_empty_local_file( localfile, L".msi" );
1439 if (r != ERROR_SUCCESS)
1440 {
1441 msiobj_release( &db->hdr );
1442 return r;
1443 }
1444
1445 if (!CopyFileW( file, localfile, FALSE ))
1446 {
1447 r = GetLastError();
1448 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1449 DeleteFileW( localfile );
1450 msiobj_release( &db->hdr );
1451 return r;
1452 }
1453 delete_on_close = TRUE;
1454
1455 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1456 localfile_attr = GetFileAttributesW( localfile );
1457 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1458 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1459 }
1461 {
1462 if (!CopyFileW( file, localfile, FALSE ))
1463 {
1464 r = GetLastError();
1465 WARN("unable to update cached package (%u)\n", r);
1466 msiobj_release( &db->hdr );
1467 return r;
1468 }
1469 }
1470 else
1471 product_version = get_product_version( db );
1472 msiobj_release( &db->hdr );
1473 TRACE("opening package %s\n", debugstr_w( localfile ));
1474 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1475 if (r != ERROR_SUCCESS)
1476 {
1477 free( product_version );
1478 return r;
1479 }
1480
1481 if (product_version)
1482 {
1483 WCHAR *cache_version = get_product_version( db );
1484 if (!product_version != !cache_version ||
1485 (product_version && wcscmp(product_version, cache_version)))
1486 {
1487 msiobj_release( &db->hdr );
1488 free( product_version );
1489 free( cache_version );
1490 return ERROR_PRODUCT_VERSION;
1491 }
1492 free( product_version );
1493 free( cache_version );
1494 }
1495 }
1496 package = MSI_CreatePackage( db );
1497 msiobj_release( &db->hdr );
1498 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1499 package->localfile = wcsdup( localfile );
1500 package->delete_on_close = delete_on_close;
1501
1502 r = msi_get_suminfo( db->storage, 0, &si );
1503 if (r != ERROR_SUCCESS)
1504 {
1505 r = msi_get_db_suminfo( db, 0, &si );
1506 if (r != ERROR_SUCCESS)
1507 {
1508 WARN("failed to load summary info\n");
1509 msiobj_release( &package->hdr );
1511 }
1512 }
1513 r = parse_suminfo( si, package );
1514 msiobj_release( &si->hdr );
1515 if (r != ERROR_SUCCESS)
1516 {
1517 WARN("failed to parse summary info %u\n", r);
1518 msiobj_release( &package->hdr );
1519 return r;
1520 }
1521 r = validate_package( package );
1522 if (r != ERROR_SUCCESS)
1523 {
1524 msiobj_release( &package->hdr );
1525 return r;
1526 }
1527 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1528 set_installed_prop( package );
1529 msi_set_context( package );
1530
1531 product_code = get_product_code( db );
1532 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1533 {
1534 TRACE("product already registered\n");
1535 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1536 }
1537 free( product_code );
1538
1539 while (1)
1540 {
1541 WCHAR patch_code[GUID_SIZE];
1542 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1543 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1544 if (r != ERROR_SUCCESS)
1545 break;
1546
1547 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1548
1549 r = msi_apply_registered_patch( package, patch_code );
1550 if (r != ERROR_SUCCESS)
1551 {
1552 ERR("registered patch failed to apply %u\n", r);
1553 msiobj_release( &package->hdr );
1554 return r;
1555 }
1556 index++;
1557 }
1558 if (index) msi_adjust_privilege_properties( package );
1559
1560 r = msi_set_original_database_property( package->db, szPackage );
1561 if (r != ERROR_SUCCESS)
1562 {
1563 msiobj_release( &package->hdr );
1564 return r;
1565 }
1566 if (gszLogFile)
1569
1570 /* FIXME: when should these messages be sent? */
1571 data_row = MSI_CreateRecord(3);
1572 if (!data_row)
1573 return ERROR_OUTOFMEMORY;
1574 MSI_RecordSetStringW(data_row, 0, NULL);
1575 MSI_RecordSetInteger(data_row, 1, 0);
1576 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1579
1580 info_row = MSI_CreateRecord(0);
1581 if (!info_row)
1582 {
1583 msiobj_release(&data_row->hdr);
1584 return ERROR_OUTOFMEMORY;
1585 }
1586 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1587 MSI_RecordSetStringW(info_row, 0, info_template);
1588 free(info_template);
1590
1592
1593 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1594 MSI_RecordSetInteger(data_row, 1, 1);
1595 MSI_RecordSetStringW(data_row, 2, productname);
1596 MSI_RecordSetStringW(data_row, 3, NULL);
1598
1599 free(productname);
1600 msiobj_release(&info_row->hdr);
1601 msiobj_release(&data_row->hdr);
1602
1603 *pPackage = package;
1604 return ERROR_SUCCESS;
1605}
1606
1608{
1609 MSIPACKAGE *package = NULL;
1610 UINT ret;
1611
1612 TRACE( "%s, %#lx, %p\n", debugstr_w(szPackage), dwOptions, phPackage );
1613
1614 if( !szPackage || !phPackage )
1616
1617 if ( !*szPackage )
1618 {
1619 FIXME("Should create an empty database and package\n");
1620 return ERROR_FUNCTION_FAILED;
1621 }
1622
1623 if( dwOptions )
1624 FIXME( "dwOptions %#lx not supported\n", dwOptions );
1625
1626 ret = MSI_OpenPackageW( szPackage, 0, &package );
1627 if( ret == ERROR_SUCCESS )
1628 {
1629 *phPackage = alloc_msihandle( &package->hdr );
1630 if (! *phPackage)
1632 msiobj_release( &package->hdr );
1633 }
1634 else
1636
1637 return ret;
1638}
1639
1641{
1642 return MsiOpenPackageExW( szPackage, 0, phPackage );
1643}
1644
1646{
1647 LPWSTR szwPack = NULL;
1648 UINT ret;
1649
1650 if( szPackage )
1651 {
1652 szwPack = strdupAtoW( szPackage );
1653 if( !szwPack )
1654 return ERROR_OUTOFMEMORY;
1655 }
1656
1657 ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
1658
1659 free( szwPack );
1660
1661 return ret;
1662}
1663
1665{
1666 return MsiOpenPackageExA( szPackage, 0, phPackage );
1667}
1668
1670{
1671 MSIPACKAGE *package;
1672 MSIHANDLE handle = 0;
1673 MSIHANDLE remote;
1674
1675 TRACE( "%lu\n", hInstall );
1676
1677 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
1678 if( package)
1679 {
1680 handle = alloc_msihandle( &package->db->hdr );
1681 msiobj_release( &package->hdr );
1682 }
1683 else if ((remote = msi_get_remote(hInstall)))
1684 {
1685 __TRY
1686 {
1687 handle = remote_GetActiveDatabase(remote);
1689 }
1691 {
1692 handle = 0;
1693 }
1694 __ENDTRY
1695 }
1696
1697 return handle;
1698}
1699
1701{
1702 if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
1703 return 0;
1704
1705 /* todo: check if message needs additional styles (topmost/foreground/modality?) */
1706
1707 switch (eMessageType & 0xff000000)
1708 {
1712 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1713 if (!(eMessageType & MB_ICONMASK))
1714 eMessageType |= MB_ICONEXCLAMATION;
1715 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1717 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1718 if (!(eMessageType & MB_ICONMASK))
1719 eMessageType |= MB_ICONASTERISK;
1720 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1722 if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
1723 if (!(eMessageType & MB_ICONMASK))
1724 eMessageType |= MB_USERICON;
1725 return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
1731 return 0;
1733 {
1735 INT rc = ACTION_DialogBox(package, dialog);
1736 free(dialog);
1737 return rc;
1738 }
1740 {
1741 LPWSTR deformatted;
1742 MSIRECORD *uirow = MSI_CreateRecord(1);
1743 if (!uirow) return -1;
1744 deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
1745 MSI_RecordSetStringW(uirow, 1, deformatted);
1746 msi_event_fire(package, L"ActionText", uirow);
1747
1748 free(deformatted);
1749 msiobj_release(&uirow->hdr);
1750 return 1;
1751 }
1753 {
1754 MSIRECORD *uirow = MSI_CreateRecord(1);
1755 if (!uirow) return -1;
1756 MSI_RecordSetStringW(uirow, 1, message);
1757 msi_event_fire(package, L"ActionData", uirow);
1758 msiobj_release(&uirow->hdr);
1759
1760 if (package->action_progress_increment)
1761 {
1762 uirow = MSI_CreateRecord(2);
1763 if (!uirow) return -1;
1764 MSI_RecordSetInteger(uirow, 1, 2);
1766 msi_event_fire(package, L"SetProgress", uirow);
1767 msiobj_release(&uirow->hdr);
1768 }
1769 return 1;
1770 }
1772 msi_event_fire(package, L"SetProgress", record);
1773 return 1;
1775 switch (MSI_RecordGetInteger(record, 1))
1776 {
1777 case 0:
1778 case 1:
1779 /* do nothing */
1780 return 0;
1781 default:
1782 /* fall through */
1783 ;
1784 }
1785 default:
1786 FIXME("internal UI not implemented for message 0x%08x (UI level = %x)\n", eMessageType, package->ui_level);
1787 return 0;
1788 }
1789}
1790
1791static const struct
1792{
1793 int id;
1794 const WCHAR *text;
1795}
1797{
1798 {2726, L"DEBUG: Error [1]: Action not found: [2]"},
1799 {0}
1801
1803{
1804 int i = 0;
1805
1806 while (internal_errors[i].id != 0)
1807 {
1808 if (internal_errors[i].id == error)
1809 return internal_errors[i].text;
1810 i++;
1811 }
1812
1813 FIXME("missing error message %d\n", error);
1814 return NULL;
1815}
1816
1817/* Returned string must be freed */
1819{
1821 LPWSTR ret = NULL;
1822
1823 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1824 {
1826 msiobj_release(&record->hdr);
1827 }
1828 else if (error < 2000)
1829 {
1831 if (len)
1832 {
1833 ret = malloc((len + 1) * sizeof(WCHAR));
1835 }
1836 else
1837 ret = NULL;
1838 }
1839
1840 return ret;
1841}
1842
1844{
1845 LPWSTR message = {0};
1846 DWORD len;
1847 DWORD log_type = 1 << (eMessageType >> 24);
1848 UINT res;
1849 INT rc = 0;
1850 char *msg;
1851
1852 TRACE("%x\n", eMessageType);
1853 if (TRACE_ON(msi)) dump_record(record);
1854
1855 if (!package || !record)
1856 message = NULL;
1857 else {
1858 res = MSI_FormatRecordW(package, record, message, &len);
1859 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1860 return res;
1861 len++;
1862 message = malloc(len * sizeof(WCHAR));
1863 if (!message) return ERROR_OUTOFMEMORY;
1864 MSI_FormatRecordW(package, record, message, &len);
1865 }
1866
1867 /* convert it to ANSI */
1868 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1869 msg = malloc( len );
1871
1872 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1873 {
1874 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1875 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1876 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1877 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1878 MsiCloseHandle( rec );
1879 }
1880 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1881 {
1882 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1883 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1884 rc = gUIHandlerW( gUIContext, eMessageType, message );
1885 }
1886 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1887 {
1888 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1889 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1890 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1891 }
1892
1893 if (!rc)
1894 rc = internal_ui_handler(package, eMessageType, record, message);
1895
1896 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1897 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1898 {
1899 DWORD written;
1900 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1901 WriteFile( package->log_file, "\n", 1, &written, NULL );
1902 }
1903 free( msg );
1904 free( message );
1905
1906 return rc;
1907}
1908
1910{
1911 switch (eMessageType & 0xff000000)
1912 {
1920 {
1921 /* error message */
1922
1923 LPWSTR template;
1924 LPWSTR template_rec = NULL, template_prefix = NULL;
1926
1927 if (MSI_RecordIsNull(record, 0))
1928 {
1929 if (error >= 32)
1930 {
1931 template_rec = msi_get_error_message(package->db, error);
1932
1933 if (!template_rec && error >= 2000)
1934 {
1935 /* internal error, not localized */
1936 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1937 {
1938 MSI_RecordSetStringW(record, 0, template_rec);
1940 }
1941 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1942 MSI_RecordSetStringW(record, 0, template_rec);
1943 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1944 free(template_rec);
1945 return 0;
1946 }
1947 }
1948 }
1949 else
1950 template_rec = msi_dup_record_field(record, 0);
1951
1952 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1953 if (!template_prefix) template_prefix = wcsdup(L"");
1954
1955 if (!template_rec)
1956 {
1957 /* always returns 0 */
1958 MSI_RecordSetStringW(record, 0, template_prefix);
1959 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1960 free(template_prefix);
1961 return 0;
1962 }
1963
1964 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1965 if (!template)
1966 {
1967 free(template_prefix);
1968 free(template_rec);
1969 return ERROR_OUTOFMEMORY;
1970 }
1971
1972 lstrcpyW(template, template_prefix);
1973 lstrcatW(template, template_rec);
1974 MSI_RecordSetStringW(record, 0, template);
1975
1976 free(template_prefix);
1977 free(template_rec);
1978 free(template);
1979 }
1980 break;
1982 {
1983 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
1984 MSI_RecordSetStringW(record, 0, template);
1985 free(template);
1986
1987 free(package->LastAction);
1988 free(package->LastActionTemplate);
1989 package->LastAction = msi_dup_record_field(record, 1);
1990 if (!package->LastAction) package->LastAction = wcsdup(L"");
1992 break;
1993 }
1995 if (package->LastAction && package->LastActionTemplate)
1996 {
1997 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
1998 WCHAR *template = malloc(len * sizeof(WCHAR));
1999 if (!template) return ERROR_OUTOFMEMORY;
2000 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2001 MSI_RecordSetStringW(record, 0, template);
2002 free(template);
2003 }
2004 break;
2006 {
2007 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2008 MSI_RecordSetStringW(record, 0, template);
2009 free(template);
2010 }
2011 break;
2012 }
2013
2014 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2015}
2016
2018 MSIHANDLE hRecord)
2019{
2021 MSIPACKAGE *package = NULL;
2023
2024 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE ||
2025 (eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE)
2026 return -1;
2027
2028 if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA &&
2029 MsiRecordGetInteger(hRecord, 1) != 2)
2030 return -1;
2031
2033 if (!record)
2034 return ERROR_INVALID_HANDLE;
2035
2036 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
2037 if( !package )
2038 {
2039 MSIHANDLE remote;
2040
2041 if (!(remote = msi_get_remote(hInstall)))
2042 return ERROR_INVALID_HANDLE;
2043
2044 __TRY
2045 {
2046 ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count);
2047 }
2049 {
2051 }
2052 __ENDTRY
2053
2054 msiobj_release(&record->hdr);
2055 return ret;
2056 }
2057
2058 ret = MSI_ProcessMessage( package, eMessageType, record );
2059
2060 msiobj_release( &record->hdr );
2061 msiobj_release( &package->hdr );
2062 return ret;
2063}
2064
2065/* property code */
2066
2068{
2069 LPWSTR szwName = NULL, szwValue = NULL;
2071
2072 szwName = strdupAtoW( szName );
2073 if( szName && !szwName )
2074 goto end;
2075
2076 szwValue = strdupAtoW( szValue );
2077 if( szValue && !szwValue )
2078 goto end;
2079
2080 r = MsiSetPropertyW( hInstall, szwName, szwValue);
2081
2082end:
2083 free( szwName );
2084 free( szwValue );
2085
2086 return r;
2087}
2088
2090{
2092
2094 {
2095 free( folder->ResolvedSource );
2096 folder->ResolvedSource = NULL;
2097 }
2098}
2099
2101{
2102 MSIQUERY *view;
2103 MSIRECORD *row = NULL;
2104 DWORD sz = 0;
2105 WCHAR query[1024];
2106 UINT rc;
2107
2108 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2109
2110 if (!name)
2112
2113 /* this one is weird... */
2114 if (!name[0])
2116
2117 if (value && len < 0) len = lstrlenW( value );
2118
2119 rc = msi_get_property( db, name, 0, &sz );
2120 if (!value || (!*value && !len))
2121 {
2122 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2123 }
2124 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2125 {
2126 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2127 row = MSI_CreateRecord(1);
2129 }
2130 else
2131 {
2132 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2133 row = MSI_CreateRecord(2);
2134 msi_record_set_string( row, 1, name, -1 );
2136 }
2137
2138 rc = MSI_DatabaseOpenViewW(db, query, &view);
2139 if (rc == ERROR_SUCCESS)
2140 {
2141 rc = MSI_ViewExecute(view, row);
2143 msiobj_release(&view->hdr);
2144 }
2145 if (row) msiobj_release(&row->hdr);
2146 return rc;
2147}
2148
2150{
2151 MSIPACKAGE *package;
2152 UINT ret;
2153
2154 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
2155 if( !package )
2156 {
2157 MSIHANDLE remote;
2158
2159 if (!(remote = msi_get_remote(hInstall)))
2160 return ERROR_INVALID_HANDLE;
2161
2162 __TRY
2163 {
2164 ret = remote_SetProperty(remote, szName, szValue);
2165 }
2167 {
2169 }
2170 __ENDTRY
2171
2172 return ret;
2173 }
2174
2175 ret = msi_set_property( package->db, szName, szValue, -1 );
2176 if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
2177 msi_reset_source_folders( package );
2178
2179 msiobj_release( &package->hdr );
2180 return ret;
2181}
2182
2184{
2185 MSIRECORD *rec, *row = NULL;
2186 MSIQUERY *view;
2187 UINT r;
2188 WCHAR *buffer;
2189 int length;
2190
2191 if (!name || !*name)
2192 return NULL;
2193
2194 if (!wcscmp(name, L"Date"))
2195 {
2197 if (!length)
2198 return NULL;
2199 buffer = malloc(length * sizeof(WCHAR));
2201
2202 row = MSI_CreateRecord(1);
2203 if (!row)
2204 {
2205 free(buffer);
2206 return NULL;
2207 }
2209 free(buffer);
2210 return row;
2211 }
2212 else if (!wcscmp(name, L"Time"))
2213 {
2215 if (!length)
2216 return NULL;
2217 buffer = malloc(length * sizeof(WCHAR));
2219
2220 row = MSI_CreateRecord(1);
2221 if (!row)
2222 {
2223 free(buffer);
2224 return NULL;
2225 }
2227 free(buffer);
2228 return row;
2229 }
2230
2231 rec = MSI_CreateRecord(1);
2232 if (!rec)
2233 return NULL;
2234
2235 MSI_RecordSetStringW(rec, 1, name);
2236
2237 r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
2238 if (r == ERROR_SUCCESS)
2239 {
2240 MSI_ViewExecute(view, rec);
2243 msiobj_release(&view->hdr);
2244 }
2245 msiobj_release(&rec->hdr);
2246 return row;
2247}
2248
2249/* internal function, not compatible with MsiGetPropertyW */
2251 LPWSTR szValueBuf, LPDWORD pchValueBuf )
2252{
2253 MSIRECORD *row;
2255
2256 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2257
2258 row = get_property_row( db, szName );
2259
2260 if (*pchValueBuf > 0)
2261 szValueBuf[0] = 0;
2262
2263 if (row)
2264 {
2265 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2266 msiobj_release(&row->hdr);
2267 }
2268
2269 if (rc == ERROR_SUCCESS)
2270 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2272 else if (rc == ERROR_MORE_DATA)
2273 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2274 else
2275 {
2276 *pchValueBuf = 0;
2277 TRACE("property %s not found\n", debugstr_w(szName));
2278 }
2279
2280 return rc;
2281}
2282
2284{
2285 DWORD sz = 0;
2286 LPWSTR str;
2287 UINT r;
2288
2289 r = msi_get_property(db, prop, NULL, &sz);
2290 if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2291 return NULL;
2292
2293 sz++;
2294 str = malloc(sz * sizeof(WCHAR));
2295 r = msi_get_property(db, prop, str, &sz);
2296 if (r != ERROR_SUCCESS)
2297 {
2298 free(str);
2299 str = NULL;
2300 }
2301
2302 return str;
2303}
2304
2306{
2307 LPWSTR str = msi_dup_property( db, prop );
2308 int val = str ? wcstol(str, NULL, 10) : def;
2309 free(str);
2310 return val;
2311}
2312
2314{
2315 const WCHAR *value = L"";
2316 MSIPACKAGE *package;
2317 MSIRECORD *row;
2318 WCHAR *nameW;
2319 int len = 0;
2320 UINT r;
2321
2322 if (!name)
2324
2325 if (!(nameW = strdupAtoW(name)))
2326 return ERROR_OUTOFMEMORY;
2327
2328 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2329 if (!package)
2330 {
2331 WCHAR *value = NULL, *tmp;
2332 MSIHANDLE remote;
2333 DWORD len;
2334
2335 if (!(remote = msi_get_remote(hinst)))
2336 {
2337 free(nameW);
2338 return ERROR_INVALID_HANDLE;
2339 }
2340
2341 __TRY
2342 {
2343 r = remote_GetProperty(remote, nameW, &value, &len);
2344 }
2346 {
2347 r = GetExceptionCode();
2348 }
2349 __ENDTRY
2350
2351 free(nameW);
2352
2353 if (!r)
2354 {
2355 /* String might contain embedded nulls.
2356 * Native returns the correct size but truncates the string. */
2357 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2358 if (!tmp)
2359 {
2361 return ERROR_OUTOFMEMORY;
2362 }
2363 lstrcpyW(tmp, value);
2364
2365 r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
2366
2367 free(tmp);
2368 }
2370 return r;
2371 }
2372
2373 row = get_property_row(package->db, nameW);
2374 if (row)
2376
2377 r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
2378
2379 free(nameW);
2380 if (row) msiobj_release(&row->hdr);
2381 msiobj_release(&package->hdr);
2382 return r;
2383}
2384
2386{
2387 const WCHAR *value = L"";
2388 MSIPACKAGE *package;
2389 MSIRECORD *row;
2390 int len = 0;
2391 UINT r;
2392
2393 if (!name)
2395
2396 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
2397 if (!package)
2398 {
2399 WCHAR *value = NULL, *tmp;
2400 MSIHANDLE remote;
2401 DWORD len;
2402
2403 if (!(remote = msi_get_remote(hinst)))
2404 return ERROR_INVALID_HANDLE;
2405
2406 __TRY
2407 {
2408 r = remote_GetProperty(remote, name, &value, &len);
2409 }
2411 {
2412 r = GetExceptionCode();
2413 }
2414 __ENDTRY
2415
2416 if (!r)
2417 {
2418 /* String might contain embedded nulls.
2419 * Native returns the correct size but truncates the string. */
2420 tmp = calloc(1, (len + 1) * sizeof(WCHAR));
2421 if (!tmp)
2422 {
2424 return ERROR_OUTOFMEMORY;
2425 }
2426 lstrcpyW(tmp, value);
2427
2428 r = msi_strncpyW(tmp, len, buf, sz);
2429
2430 free(tmp);
2431 }
2433 return r;
2434 }
2435
2436 row = get_property_row(package->db, name);
2437 if (row)
2439
2440 r = msi_strncpyW(value, len, buf, sz);
2441
2442 if (row) msiobj_release(&row->hdr);
2443 msiobj_release(&package->hdr);
2444 return r;
2445}
2446
2448{
2450}
2451
2453{
2454 WCHAR empty[1];
2455 UINT r;
2456
2457 *size = 0;
2459 if (r == ERROR_MORE_DATA)
2460 {
2461 ++*size;
2462 *value = midl_user_allocate(*size * sizeof(WCHAR));
2463 if (!*value)
2464 return ERROR_OUTOFMEMORY;
2466 }
2467 return r;
2468}
2469
2471{
2473}
2474
2476{
2477 MSIHANDLE rec;
2478 int ret;
2479 UINT r;
2480
2481 if ((r = unmarshal_record(remote_rec, &rec)))
2482 return r;
2483
2485
2486 MsiCloseHandle(rec);
2487 return ret;
2488}
2489
2491{
2492 return MsiDoActionW(hinst, action);
2493}
2494
2496{
2497 return MsiSequenceW(hinst, table, sequence);
2498}
2499
2501{
2502 WCHAR empty[1];
2503 DWORD size = 0;
2504 UINT r;
2505
2507 if (r == ERROR_MORE_DATA)
2508 {
2509 *value = midl_user_allocate(++size * sizeof(WCHAR));
2510 if (!*value)
2511 return ERROR_OUTOFMEMORY;
2513 }
2514 return r;
2515}
2516
2518{
2520}
2521
2523{
2524 WCHAR empty[1];
2525 DWORD size = 1;
2526 UINT r;
2527
2529 if (r == ERROR_MORE_DATA)
2530 {
2531 *value = midl_user_allocate(++size * sizeof(WCHAR));
2532 if (!*value)
2533 return ERROR_OUTOFMEMORY;
2535 }
2536 return r;
2537}
2538
2540{
2541 return MsiGetMode(hinst, mode);
2542}
2543
2545{
2546 return MsiSetMode(hinst, mode, state);
2547}
2548
2550 INSTALLSTATE *installed, INSTALLSTATE *action)
2551{
2552 return MsiGetFeatureStateW(hinst, feature, installed, action);
2553}
2554
2556{
2558}
2559
2561 INSTALLSTATE *installed, INSTALLSTATE *action)
2562{
2563 return MsiGetComponentStateW(hinst, component, installed, action);
2564}
2565
2567{
2568 return MsiSetComponentStateW(hinst, component, state);
2569}
2570
2572{
2573 return MsiGetLanguage(hinst);
2574}
2575
2577{
2579}
2580
2582{
2583 WCHAR empty[1];
2584 DWORD size = 0;
2585 MSIHANDLE rec;
2586 UINT r;
2587
2588 if ((r = unmarshal_record(remote_rec, &rec)))
2589 return r;
2590
2591 r = MsiFormatRecordW(hinst, rec, empty, &size);
2592 if (r == ERROR_MORE_DATA)
2593 {
2594 *value = midl_user_allocate(++size * sizeof(WCHAR));
2595 if (!*value)
2596 {
2597 MsiCloseHandle(rec);
2598 return ERROR_OUTOFMEMORY;
2599 }
2600 r = MsiFormatRecordW(hinst, rec, *value, &size);
2601 }
2602
2603 MsiCloseHandle(rec);
2604 return r;
2605}
2606
2608{
2610}
2611
2613 MSICOSTTREE cost_tree, INSTALLSTATE state, INT *cost)
2614{
2615 return MsiGetFeatureCostW(hinst, feature, cost_tree, state, cost);
2616}
2617
2620{
2621 DWORD size = 3;
2622 return MsiEnumComponentCostsW(hinst, component, index, state, drive, &size, cost, temp);
2623}
2624
2627{
2629
2631 {
2632 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2633 }
2634
2635 info = malloc(sizeof(MSISOURCELISTINFO));
2636 if (!info)
2637 return ERROR_OUTOFMEMORY;
2638
2639 info->context = context;
2640 info->options = options;
2641 info->property = property;
2642 info->value = wcsdup(value);
2643 list_add_head(&package->sourcelist_info, &info->entry);
2644
2645 return ERROR_SUCCESS;
2646}
2647
2649 DWORD disk_id, LPWSTR volume_label, LPWSTR disk_prompt)
2650{
2651 MSIMEDIADISK *disk;
2652
2654 {
2655 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2656 }
2657
2658 disk = malloc(sizeof(MSIMEDIADISK));
2659 if (!disk)
2660 return ERROR_OUTOFMEMORY;
2661
2662 disk->context = context;
2663 disk->options = options;
2664 disk->disk_id = disk_id;
2666 disk->disk_prompt = wcsdup(disk_prompt);
2667 list_add_head(&package->sourcelist_media, &disk->entry);
2668
2669 return ERROR_SUCCESS;
2670}
static struct recvd_message * sequence
Definition: SystemMenu.c:63
#define __cdecl
Definition: accygwin.h:79
#define SDB_DATABASE_MAIN_SHIM
Definition: apphelp.h:24
#define HID_DOS_PATHS
Definition: apphelp.h:19
void WINAPI SdbReleaseDatabase(HSDB)
Definition: hsdb.c:417
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR)
Definition: hsdb.c:369
static int state
Definition: maze.c:121
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static const WCHAR nameW[]
Definition: main.c:49
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: list.h:37
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APPHELP_VALID_RESULT
Definition: apphelp.c:159
BOOL WINAPI ApphelpCheckRunAppEx(_In_ HANDLE FileHandle, _In_opt_ PVOID Unk1, _In_opt_ PVOID Unk2, _In_opt_z_ PCWSTR ApplicationName, _In_opt_ PVOID Environment, _In_opt_ USHORT ExeType, _Inout_opt_ PULONG Reason, _Out_opt_ PVOID *SdbQueryAppCompatData, _Out_opt_ PULONG SdbQueryAppCompatDataSize, _Out_opt_ PVOID *SxsData, _Out_opt_ PULONG SxsDataSize, _Out_opt_ PULONG FusionFlags, _Out_opt_ PULONG64 SomeFlag1, _Out_opt_ PULONG SomeFlag2)
Definition: apphelp.c:185
#define APPHELP_RESULT_FOUND
Definition: apphelp.c:161
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid, LPDWORD cbSid, LPWSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse)
Definition: misc.c:626
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3583
static const WCHAR empty[]
Definition: main.c:47
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define __TRY
Definition: compat.h:80
#define TRACE_ON(x)
Definition: compat.h:75
#define MAX_PATH
Definition: compat.h:34
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define CreateFileW
Definition: compat.h:741
#define __ENDTRY
Definition: compat.h:82
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
static const WCHAR *const ext[]
Definition: module.c:53
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2421
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
LANGID WINAPI GetSystemDefaultLangID(void)
Definition: locale.c:1194
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2923
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:394
const WCHAR * action
Definition: action.c:7509
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2036
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:213
void custom_stop_server(HANDLE process, HANDLE pipe)
Definition: custom.c:682
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
HINSTANCE msi_hInstance
Definition: msi_main.c:51
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4107
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4417
INT ACTION_DialogBox(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4482
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4055
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, WCHAR *szResult, DWORD *sz)
Definition: format.c:900
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
Definition: handle.c:135
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1462
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, const WCHAR *szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, INT *piCost)
Definition: install.c:1206
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1540
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1596
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:947
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:123
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:311
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, const WCHAR *szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1088
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:468
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:600
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1500
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:763
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:670
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1962
BOOL is_wow64
Definition: msi.c:52
INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
Definition: msi.c:2223
UINT __cdecl s_remote_SetInstallLevel(MSIHANDLE hinst, int level)
Definition: package.c:2576
UINT __cdecl s_remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action)
Definition: package.c:2549
static const struct @503 internal_errors[]
UINT __cdecl s_remote_Sequence(MSIHANDLE hinst, LPCWSTR table, int sequence)
Definition: package.c:2495
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1802
UINT WINAPI MsiOpenPackageA(LPCSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1664
static UINT set_user_sid_prop(MSIPACKAGE *package)
Definition: package.c:473
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1843
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2100
static void set_msi_assembly_prop(MSIPACKAGE *package)
Definition: package.c:588
static void free_package_structures(MSIPACKAGE *package)
Definition: package.c:148
UINT WINAPI MsiSetPropertyA(MSIHANDLE hInstall, LPCSTR szName, LPCSTR szValue)
Definition: package.c:2067
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1171
const WCHAR * text
Definition: package.c:1794
UINT WINAPI MsiOpenPackageExA(LPCSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1645
UINT __cdecl s_remote_EnumComponentCosts(MSIHANDLE hinst, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR drive, INT *cost, INT *temp)
Definition: package.c:2618
UINT __cdecl s_remote_GetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
Definition: package.c:2500
UINT __cdecl s_remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state)
Definition: package.c:2544
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1026
static void free_folder(MSIFOLDER *folder)
Definition: package.c:86
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1669
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1909
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1818
MSIHANDLE __cdecl s_remote_GetActiveDatabase(MSIHANDLE hinst)
Definition: package.c:2447
UINT __cdecl s_remote_FormatRecord(MSIHANDLE hinst, struct wire_record *remote_rec, LPWSTR *value)
Definition: package.c:2581
static enum platform parse_platform(const WCHAR *str)
Definition: package.c:1092
int id
Definition: package.c:1793
UINT WINAPI MsiOpenPackageW(LPCWSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1640
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
Definition: package.c:2385
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:631
static void MSI_FreePackage(MSIOBJECTHDR *arg)
Definition: package.c:339
void msi_adjust_privilege_properties(MSIPACKAGE *package)
Definition: package.c:964
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
Definition: package.c:521
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:365
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1298
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1247
UINT __cdecl s_remote_SetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPCWSTR value)
Definition: package.c:2517
UINT msi_clone_properties(MSIDATABASE *db)
Definition: package.c:381
static UINT get_registered_local_package(const WCHAR *product, WCHAR *localfile)
Definition: package.c:1252
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1102
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1700
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2183
UINT msi_set_original_database_property(MSIDATABASE *db, const WCHAR *package)
Definition: package.c:1310
UINT __cdecl s_remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state)
Definition: package.c:2566
static UINT load_admin_properties(MSIPACKAGE *package)
Definition: package.c:949
WCHAR * msi_get_package_code(MSIDATABASE *db)
Definition: package.c:1277
MSIPACKAGE * MSI_CreatePackage(MSIDATABASE *db)
Definition: package.c:977
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1242
static void free_extension(MSIEXTENSION *ext)
Definition: package.c:106
UINT __cdecl s_remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state)
Definition: package.c:2555
UINT WINAPI MsiOpenPackageExW(const WCHAR *szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
Definition: package.c:1607
LANGID __cdecl s_remote_GetLanguage(MSIHANDLE hinst)
Definition: package.c:2571
UINT __cdecl s_remote_GetFeatureCost(MSIHANDLE hinst, LPCWSTR feature, MSICOSTTREE cost_tree, INSTALLSTATE state, INT *cost)
Definition: package.c:2612
static void free_feature(MSIFEATURE *feature)
Definition: package.c:61
BOOL __cdecl s_remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode)
Definition: package.c:2539
static MSIPACKAGE * alloc_package(void)
Definition: package.c:918
void msi_free_action_script(MSIPACKAGE *package, UINT script)
Definition: package.c:137
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT WINAPI MsiSetPropertyW(MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue)
Definition: package.c:2149
UINT __cdecl s_remote_GetProperty(MSIHANDLE hinst, LPCWSTR property, LPWSTR *value, DWORD *size)
Definition: package.c:2452
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop)
Definition: package.c:2283
UINT __cdecl s_remote_SetProperty(MSIHANDLE hinst, LPCWSTR property, LPCWSTR value)
Definition: package.c:2470
int __cdecl s_remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, struct wire_record *remote_rec)
Definition: package.c:2475
static WCHAR * get_property(MSIDATABASE *db, const WCHAR *prop)
Definition: package.c:1214
UINT __cdecl s_remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value)
Definition: package.c:2522
UINT __cdecl s_remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action)
Definition: package.c:2560
UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
Definition: package.c:2313
UINT __cdecl s_remote_DoAction(MSIHANDLE hinst, LPCWSTR action)
Definition: package.c:2490
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1062
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1384
static void free_assembly(MSIASSEMBLY *assembly)
Definition: package.c:126
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2017
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2305
MSICONDITION __cdecl s_remote_EvaluateCondition(MSIHANDLE hinst, LPCWSTR condition)
Definition: package.c:2607
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
UINT WINAPI MsiEnumPatchesExW(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, WCHAR *szPatchCode, WCHAR *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1949
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define IDS_ERROR_BASE
Definition: resource.h:33
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
#define MSIERR_COMMONDATA
Definition: resource.h:23
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
#define swprintf
Definition: precomp.h:40
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
#define progid(str)
Definition: exdisp.idl:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
ULONG Handle
Definition: gdb_input.c:15
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLenum condition
Definition: glext.h:9255
GLuint index
Definition: glext.h:6031
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
const char cursor[]
Definition: icontest.c:13
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define GetExceptionCode
Definition: excpt.h:83
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_wn
Definition: kernel32.h:33
#define debugstr_w
Definition: kernel32.h:32
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
static IN LPSTR IN PVOID Unk2
Definition: ldrinit.c:47
static IN LPSTR Unk1
Definition: ldrinit.c:47
USHORT LANGID
Definition: mui.h:9
enum _SID_NAME_USE SID_NAME_USE
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR dc[]
__u16 time
Definition: mkdosfs.c:8
__u8 volume_label[11]
Definition: mkdosfs.c:4
#define error(str)
Definition: mkdosfs.c:1605
char * appid
Definition: mkisofs.c:161
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CREATE_NEW
Definition: disk.h:69
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned __int64 * PULONG64
Definition: imports.h:198
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 PULONG SomeFlag2
Definition: env.c:49
LPCWSTR LPCWSTR LPCWSTR DWORD PSDBQUERYRESULT_VISTA pQueryResult
Definition: env.c:37
PVOID PVOID PWCHAR PVOID USHORT ExeType
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID * SdbQueryAppCompatData
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG SxsDataSize
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 SomeFlag1
Definition: env.c:49
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID * SxsData
Definition: env.c:48
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG FusionFlags
Definition: env.c:49
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG SdbQueryAppCompatDataSize
Definition: env.c:48
PVOID PVOID PWCHAR ApplicationName
Definition: env.c:47
static PVOID ptr
Definition: dispmode.c:27
static HINSTANCE hinst
Definition: edit.c:551
static HDC
Definition: imagelist.c:88
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586
#define PID_TEMPLATE
Definition: suminfo.c:49
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_REVNUMBER
Definition: suminfo.c:51
static WCHAR user_name[UNLEN+1]
Definition: access.c:32
INTERNETFEATURELIST feature
Definition: misc.c:1719
static ATOM item
Definition: dde.c:856
static HWND dialog
Definition: gui.c:33
static WCHAR username[]
Definition: url.c:32
LANGID langid
Definition: msctf.idl:644
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
void msi_destroy_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:89
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
@ INSTALLMESSAGE_WARNING
Definition: msi.h:96
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
@ INSTALLMESSAGE_USER
Definition: msi.h:97
@ INSTALLMESSAGE_PROGRESS
Definition: msi.h:104
@ INSTALLMESSAGE_TERMINATE
Definition: msi.h:107
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_OUTOFDISKSPACE
Definition: msi.h:101
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_FATALEXIT
Definition: msi.h:94
@ INSTALLMESSAGE_INITIALIZE
Definition: msi.h:106
@ INSTALLMESSAGE_INSTALLSTART
Definition: msi.h:110
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
@ INSTALLMESSAGE_INSTALLEND
Definition: msi.h:111
@ INSTALLUILEVEL_NONE
Definition: msi.h:66
@ INSTALLUILEVEL_PROGRESSONLY
Definition: msi.h:71
WCHAR * gszLogFile
Definition: msi_main.c:50
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
LPVOID gUIContext
Definition: msi_main.c:48
HWND gUIhwnd
Definition: msi_main.c:42
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:502
static const BOOL is_64bit
Definition: msipriv.h:44
void dump_record(MSIRECORD *)
Definition: record.c:1028
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int)
Definition: record.c:573
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
UINT msi_clone_properties(MSIDATABASE *)
Definition: package.c:381
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2089
const WCHAR * msi_record_get_string(const MSIRECORD *, UINT, int *)
Definition: record.c:420
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:725
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index)
Definition: record.c:1002
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:692
script
Definition: msipriv.h:383
@ SCRIPT_NONE
Definition: msipriv.h:384
@ SCRIPT_MAX
Definition: msipriv.h:388
#define GUID_SIZE
Definition: msipriv.h:733
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:454
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1843
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
Definition: package.c:2648
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code)
Definition: patch.c:990
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *)
Definition: package.c:1310
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1267
INT msi_suminfo_get_int32(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:713
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:492
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2250
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:884
BOOL MSI_RecordIsNull(MSIRECORD *, UINT)
Definition: record.c:321
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT)
Definition: record.c:166
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property)
Definition: suminfo.c:701
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:377
WCHAR * msi_reg_get_val_str(HKEY hkey, const WCHAR *name)
#define MSI_MINORVERSION
Definition: msipriv.h:730
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
platform
Definition: msipriv.h:364
@ PLATFORM_X64
Definition: msipriv.h:368
@ PLATFORM_UNRECOGNIZED
Definition: msipriv.h:365
@ PLATFORM_INTEL64
Definition: msipriv.h:367
@ PLATFORM_INTEL
Definition: msipriv.h:366
@ PLATFORM_ARM
Definition: msipriv.h:369
@ PLATFORM_ARM64
Definition: msipriv.h:370
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:462
#define MSI_MAJORVERSION
Definition: msipriv.h:729
WCHAR * msi_get_error_message(MSIDATABASE *, int)
Definition: package.c:1818
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1384
UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out)
Definition: record.c:1095
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:964
UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
Definition: package.c:2625
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD)
MSICONDITION WINAPI MsiEvaluateConditionW(MSIHANDLE, LPCWSTR)
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
unsigned int UINT
Definition: ndis.h:50
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define VER_PLATFORM_WIN32_NT
Definition: rtltypes.h:238
#define VER_PLATFORM_WIN32_WINDOWS
Definition: rtltypes.h:237
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define GENERIC_WRITE
Definition: nt_native.h:90
#define LOCALE_USER_DEFAULT
#define L(x)
Definition: ntvdm.h:50
#define PathAddBackslashW
Definition: pathcch.h:301
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static const WCHAR szName[]
Definition: powrprof.c:45
#define __EXCEPT(func)
Definition: exception.h:84
#define calloc
Definition: rosglue.h:14
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
RPC_STATUS WINAPI RpcServerUnregisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
Definition: rpc_server.c:1202
const WCHAR * str
static calc_node_t temp
Definition: rpn_ieee.c:38
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANGID(l)
Definition: nls.h:17
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define midl_user_free
Definition: rpc.h:45
#define midl_user_allocate
Definition: rpc.h:44
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
BOOL WINAPI SE_DynamicShim(LPCWSTR ProcessImage, HSDB hsdb, PVOID pQueryResult, LPCSTR Module, LPDWORD lpdwDynamicToken)
Definition: shimeng.c:1487
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_TEMPLATES
Definition: shlobj.h:2193
#define CSIDL_SENDTO
Definition: shlobj.h:2182
#define CSIDL_RECENT
Definition: shlobj.h:2181
#define CSIDL_ADMINTOOLS
Definition: shlobj.h:2220
#define CSIDL_FONTS
Definition: shlobj.h:2192
#define CSIDL_PERSONAL
Definition: shlobj.h:2178
#define CSIDL_FAVORITES
Definition: shlobj.h:2179
#define CSIDL_COMMON_APPDATA
Definition: shlobj.h:2207
#define CSIDL_MYPICTURES
Definition: shlobj.h:2211
#define CSIDL_SYSTEM
Definition: shlobj.h:2209
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2200
#define CSIDL_DESKTOP
Definition: shlobj.h:2173
#define CSIDL_STARTMENU
Definition: shlobj.h:2184
#define CSIDL_PROGRAMS
Definition: shlobj.h:2175
#define CSIDL_APPDATA
Definition: shlobj.h:2198
#define CSIDL_PRINTHOOD
Definition: shlobj.h:2199
#define CSIDL_STARTUP
Definition: shlobj.h:2180
#define CSIDL_WINDOWS
Definition: shlobj.h:2208
#define CSIDL_NETHOOD
Definition: shlobj.h:2191
@ URLIS_URL
Definition: shlwapi.h:1217
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwOptions
Definition: solitaire.cpp:25
Definition: wininet.h:2127
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:269
ULONG dwPlatformId
Definition: rtltypes.h:273
UCHAR wProductType
Definition: rtltypes.h:278
ULONG dwBuildNumber
Definition: rtltypes.h:272
USHORT wServicePackMajor
Definition: rtltypes.h:275
WORD wProcessorLevel
Definition: winbase.h:1205
WORD wProcessorArchitecture
Definition: winbase.h:1194
struct file_info manifest
Definition: actctx.c:527
Definition: svc_auth_des.c:77
Definition: http.c:7252
Definition: fci.c:127
struct list entry
Definition: fci.c:128
Definition: fci.c:116
struct list entry
Definition: fci.c:117
WORD wLanguage
Definition: package.c:584
WORD wCodePage
Definition: package.c:585
Definition: tftpd.h:60
Definition: name.c:39
struct list entry
Definition: msipriv.h:553
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
LPWSTR clsid
Definition: msipriv.h:652
LPWSTR IconPath
Definition: msipriv.h:660
LPWSTR Argument
Definition: msipriv.h:663
LPWSTR ProgIDText
Definition: msipriv.h:656
LPWSTR DefInprocHandler
Definition: msipriv.h:661
LPWSTR FileTypeMask
Definition: msipriv.h:659
struct list entry
Definition: msipriv.h:651
LPWSTR Description
Definition: msipriv.h:657
LPWSTR DefInprocHandler32
Definition: msipriv.h:662
LPWSTR Context
Definition: msipriv.h:653
LPWSTR Component
Definition: msipriv.h:524
LPWSTR ComponentId
Definition: msipriv.h:525
MSIASSEMBLY * assembly
Definition: msipriv.h:540
struct list entry
Definition: msipriv.h:523
LPWSTR KeyPath
Definition: msipriv.h:529
LPWSTR Condition
Definition: msipriv.h:528
LPWSTR Directory
Definition: msipriv.h:526
LPWSTR FullKeypath
Definition: msipriv.h:538
MSIOBJECTHDR hdr
Definition: msipriv.h:108
IStorage * storage
Definition: msipriv.h:109
string_table * strings
Definition: msipriv.h:110
LPWSTR path
Definition: msipriv.h:112
WCHAR * path
Definition: msipriv.h:632
struct list entry
Definition: msipriv.h:625
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
LPWSTR volume_label
Definition: msipriv.h:172
struct list entry
Definition: msipriv.h:168
LPWSTR disk_prompt
Definition: msipriv.h:173
DWORD disk_id
Definition: msipriv.h:171
LPWSTR ContentType
Definition: msipriv.h:711
LPWSTR clsid
Definition: msipriv.h:714
struct list entry
Definition: msipriv.h:710
LPWSTR suffix
Definition: msipriv.h:713
int unique_actions_count
Definition: msipriv.h:436
struct list progids
Definition: msipriv.h:428
struct list subscriptions
Definition: msipriv.h:461
BOOL delete_on_close
Definition: msipriv.h:450
UINT WordCount
Definition: msipriv.h:458
struct list classes
Definition: msipriv.h:426
LPWSTR LastAction
Definition: msipriv.h:410
struct list RunningActions
Definition: msipriv.h:440
struct list appids
Definition: msipriv.h:430
struct list features
Definition: msipriv.h:402
MSIOBJECTHDR hdr
Definition: msipriv.h:393
struct list files
Definition: msipriv.h:403
MSIDATABASE * db
Definition: msipriv.h:394
enum platform platform
Definition: msipriv.h:396
struct list cabinet_streams
Definition: msipriv.h:408
struct list extensions
Definition: msipriv.h:427
struct list folders
Definition: msipriv.h:406
UINT num_langids
Definition: msipriv.h:397
LPWSTR * unique_actions
Definition: msipriv.h:435
struct list components
Definition: msipriv.h:401
LPWSTR ProductCode
Definition: msipriv.h:448
LPWSTR PackagePath
Definition: msipriv.h:447
struct list mimes
Definition: msipriv.h:429
INSTALLUILEVEL ui_level
Definition: msipriv.h:452
UINT action_progress_increment
Definition: msipriv.h:413
struct list sourcelist_media
Definition: msipriv.h:464
LANGID * langids
Definition: msipriv.h:398
HANDLE log_file
Definition: msipriv.h:414
enum script script
Definition: msipriv.h:432
MSIINSTALLCONTEXT Context
Definition: msipriv.h:459
LPWSTR LastActionTemplate
Definition: msipriv.h:411
struct list filepatches
Definition: msipriv.h:404
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:433
LPWSTR localfile
Definition: msipriv.h:449
UINT LastActionResult
Definition: msipriv.h:412
struct list patches
Definition: msipriv.h:400
struct list binaries
Definition: msipriv.h:407
LPWSTR ActionFormat
Definition: msipriv.h:409
struct list tempfiles
Definition: msipriv.h:405
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:434
struct list sourcelist_info
Definition: msipriv.h:463
struct list entry
Definition: msipriv.h:200
LPWSTR localfile
Definition: msipriv.h:205
BOOL delete_on_close
Definition: msipriv.h:208
MSIOBJECTHDR hdr
Definition: msipriv.h:129
MSIOBJECTHDR hdr
Definition: msipriv.h:151
MSIOBJECTHDR hdr
Definition: msipriv.h:486
LPWSTR Command
Definition: msipriv.h:704
struct list entry
Definition: msipriv.h:701
LPWSTR Argument
Definition: msipriv.h:705
LPWSTR Verb
Definition: msipriv.h:702
#define LIST_ENTRY(type)
Definition: queue.h:175
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:853
Definition: pdh_main.c:94
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ FLONG fl
Definition: winddi.h:1279
#define WINAPI
Definition: msvc.h:6
int MSIRUNMODE
Definition: winemsi.idl:30
int MSICOSTTREE
Definition: winemsi.idl:34
int MSICONDITION
Definition: winemsi.idl:29
unsigned long MSIHANDLE
Definition: winemsi.idl:27
int INSTALLSTATE
Definition: winemsi.idl:31
int INSTALLMESSAGE
Definition: winemsi.idl:28
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:978
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:996
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define ERROR_PATCH_PACKAGE_INVALID
Definition: winerror.h:994
#define ERROR_INSTALL_PLATFORM_UNSUPPORTED
Definition: winerror.h:991
#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED
Definition: winerror.h:981
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define VERTRES
Definition: wingdi.h:717
#define BITSPIXEL
Definition: wingdi.h:720
#define LCID_INSTALLED
Definition: winnls.h:203
#define TIME_NOTIMEMARKER
Definition: winnls.h:281
#define DATE_SHORTDATE
Definition: winnls.h:198
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MB_ICONHAND
Definition: winuser.h:791
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONMASK
Definition: winuser.h:822
HDC WINAPI GetDC(_In_opt_ HWND)
#define MB_ICONEXCLAMATION
Definition: winuser.h:788
#define MB_USERICON
Definition: winuser.h:786
#define MB_ICONASTERISK
Definition: winuser.h:787
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193