ReactOS 0.4.17-dev-966-gf06eace
install.c
Go to the documentation of this file.
1/*
2 * Implementation of the Microsoft Installer (msi.dll)
3 *
4 * Copyright 2005 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/* Msi top level apis directly related to installs */
22
23#define COBJMACROS
24
25#include <stdarg.h>
26
27#include "windef.h"
28#include "winbase.h"
29#include "winerror.h"
30#include "msi.h"
31#include "msidefs.h"
32#include "objbase.h"
33#include "oleauto.h"
34
35#include "msipriv.h"
36#include "winemsi.h"
37#include "wine/debug.h"
38#include "wine/exception.h"
39
41
42/***********************************************************************
43 * MsiDoActionA (MSI.@)
44 */
46{
47 LPWSTR szwAction;
48 UINT ret;
49
50 TRACE("%s\n", debugstr_a(szAction));
51
52 szwAction = strdupAtoW(szAction);
53 if (szAction && !szwAction)
55
56 ret = MsiDoActionW( hInstall, szwAction );
57 free( szwAction );
58 return ret;
59}
60
61/***********************************************************************
62 * MsiDoActionW (MSI.@)
63 */
65{
66 MSIPACKAGE *package;
67 UINT ret;
68
69 TRACE("%s\n",debugstr_w(szAction));
70
71 if (!szAction)
73
74 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
75 if (!package)
76 {
77 MSIHANDLE remote;
78
79 if (!(remote = msi_get_remote(hInstall)))
81
82 __TRY
83 {
84 ret = remote_DoAction(remote, szAction);
85 }
87 {
89 }
91
92 return ret;
93 }
94
95 ret = ACTION_PerformAction(package, szAction);
96 msiobj_release( &package->hdr );
97
98 return ret;
99}
100
101/***********************************************************************
102 * MsiSequenceA (MSI.@)
103 */
104UINT WINAPI MsiSequenceA( MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode )
105{
106 LPWSTR szwTable;
107 UINT ret;
108
109 TRACE("%s, %d\n", debugstr_a(szTable), iSequenceMode);
110
111 szwTable = strdupAtoW(szTable);
112 if (szTable && !szwTable)
114
115 ret = MsiSequenceW( hInstall, szwTable, iSequenceMode );
116 free( szwTable );
117 return ret;
118}
119
120/***********************************************************************
121 * MsiSequenceW (MSI.@)
122 */
123UINT WINAPI MsiSequenceW( MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode )
124{
125 MSIPACKAGE *package;
126 UINT ret;
127
128 TRACE("%s, %d\n", debugstr_w(szTable), iSequenceMode);
129
130 if (!szTable)
132
133 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
134 if (!package)
135 {
136 MSIHANDLE remote;
137
138 if (!(remote = msi_get_remote(hInstall)))
140
141 __TRY
142 {
143 ret = remote_Sequence(remote, szTable, iSequenceMode);
144 }
146 {
148 }
150
151 return ret;
152 }
153 ret = MSI_Sequence( package, szTable );
154 msiobj_release( &package->hdr );
155 return ret;
156}
157
159{
161
162 if (awbuf->str.w && !sz)
164 if (!sz)
165 return ERROR_SUCCESS;
166
167 if (len < 0) len = lstrlenW( str );
168
169 if (awbuf->unicode && awbuf->str.w)
170 {
171 memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
172 if (*sz && len >= *sz)
173 awbuf->str.w[*sz - 1] = 0;
174 }
175 else
176 {
177 int lenA = WideCharToMultiByte( CP_ACP, 0, str, len + 1, NULL, 0, NULL, NULL );
178 if (lenA) lenA--;
179 WideCharToMultiByte( CP_ACP, 0, str, len + 1, awbuf->str.a, *sz, NULL, NULL );
180 if (awbuf->str.a && *sz && lenA >= *sz)
181 awbuf->str.a[*sz - 1] = 0;
182 len = lenA;
183 }
184 if (awbuf->str.w && len >= *sz)
186 *sz = len;
187 return r;
188}
189
190UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
191{
193 DWORD lenA;
194
195 if (!sz)
197
198 if (lenW < 0) lenW = lstrlenW(str);
199 lenA = WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, NULL, 0, NULL, NULL);
200 WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, buf, *sz, NULL, NULL);
201 lenA--;
202 if (buf && lenA >= *sz)
203 {
204 if (*sz) buf[*sz - 1] = 0;
206 }
207 if (remote && lenA >= *sz)
208 lenA *= 2;
209 *sz = lenA;
210 return r;
211}
212
214{
216
217 if (!sz)
219
220 if (len < 0) len = lstrlenW(str);
221 if (buf)
222 memcpy(buf, str, min(len + 1, *sz) * sizeof(WCHAR));
223 if (buf && len >= *sz)
224 {
225 if (*sz) buf[*sz - 1] = 0;
227 }
228 *sz = len;
229 return r;
230}
231
233{
235
236 if (!folder) return NULL;
237 if (!folder->ResolvedTarget)
238 {
240 while (parent->Parent && wcscmp( parent->Parent, parent->Directory ))
241 {
242 parent = msi_get_loaded_folder( package, parent->Parent );
243 }
244 msi_resolve_target_folder( package, parent->Directory, TRUE );
245 }
246 return folder->ResolvedTarget;
247}
248
249/***********************************************************************
250 * MsiGetTargetPathA (MSI.@)
251 */
253{
254 MSIPACKAGE *package;
255 const WCHAR *path;
256 WCHAR *folderW;
257 UINT r;
258
259 TRACE("%s %p %p\n", debugstr_a(folder), buf, sz);
260
261 if (!folder)
263
264 if (!(folderW = strdupAtoW(folder)))
265 return ERROR_OUTOFMEMORY;
266
267 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
268 if (!package)
269 {
270 WCHAR *path = NULL;
271 MSIHANDLE remote;
272
273 if (!(remote = msi_get_remote(hinst)))
274 {
275 free(folderW);
277 }
278
279 __TRY
280 {
281 r = remote_GetTargetPath(remote, folderW, &path);
282 }
284 {
286 }
288
289 if (!r)
290 r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
291
293 free(folderW);
294 return r;
295 }
296
297 path = msi_get_target_folder(package, folderW);
298 if (path)
299 r = msi_strncpyWtoA(path, -1, buf, sz, FALSE);
300 else
302
303 free(folderW);
304 msiobj_release(&package->hdr);
305 return r;
306}
307
308/***********************************************************************
309 * MsiGetTargetPathW (MSI.@)
310 */
312{
313 MSIPACKAGE *package;
314 const WCHAR *path;
315 UINT r;
316
317 TRACE("%s %p %p\n", debugstr_w(folder), buf, sz);
318
319 if (!folder)
321
322 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
323 if (!package)
324 {
325 WCHAR *path = NULL;
326 MSIHANDLE remote;
327
328 if (!(remote = msi_get_remote(hinst)))
330
331 __TRY
332 {
333 r = remote_GetTargetPath(remote, folder, &path);
334 }
336 {
338 }
340
341 if (!r)
342 r = msi_strncpyW(path, -1, buf, sz);
343
345 return r;
346 }
347
349 if (path)
350 r = msi_strncpyW(path, -1, buf, sz);
351 else
353
354 msiobj_release(&package->hdr);
355 return r;
356}
357
359{
360 msi_set_sourcedir_props( package, FALSE );
361 return msi_dup_property( package->db, L"SourceDir" );
362}
363
365{
366 MSIFOLDER *f;
367 LPWSTR p, path = NULL, parent;
368
369 TRACE("working to resolve %s\n", debugstr_w(name));
370
371 if (!wcscmp( name, L"SourceDir" )) name = L"TARGETDIR";
372 if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
373
374 /* special resolving for root dir */
375 if (!wcscmp( name, L"TARGETDIR" ) && !f->ResolvedSource)
376 {
377 f->ResolvedSource = get_source_root( package );
378 }
379 if (folder) *folder = f;
380 if (f->ResolvedSource)
381 {
382 path = wcsdup( f->ResolvedSource );
383 TRACE(" already resolved to %s\n", debugstr_w(path));
384 return path;
385 }
386 if (!f->Parent) return path;
387 parent = f->Parent;
388 TRACE(" ! parent is %s\n", debugstr_w(parent));
389
390 p = msi_resolve_source_folder( package, parent, NULL );
391
393 path = get_source_root( package );
394 else if (package->WordCount & msidbSumInfoSourceTypeSFN)
395 path = msi_build_directory_name( 3, p, f->SourceShortPath, NULL );
396 else
397 path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
398
399 TRACE("-> %s\n", debugstr_w(path));
400 f->ResolvedSource = wcsdup( path );
401 free( p );
402
403 return path;
404}
405
406/***********************************************************************
407 * MsiGetSourcePathA (MSI.@)
408 */
410{
411 MSIPACKAGE *package;
412 WCHAR *path, *folderW;
413 UINT r;
414
415 TRACE("%s %p %p\n", debugstr_a(folder), buf, sz);
416
417 if (!folder)
419
420 if (!(folderW = strdupAtoW(folder)))
421 return ERROR_OUTOFMEMORY;
422
423 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
424 if (!package)
425 {
426 WCHAR *path = NULL;
427 MSIHANDLE remote;
428
429 if (!(remote = msi_get_remote(hinst)))
430 {
431 free(folderW);
433 }
434
435 __TRY
436 {
437 r = remote_GetSourcePath(remote, folderW, &path);
438 }
440 {
442 }
444
445 if (!r)
446 r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
447
449 free(folderW);
450 return r;
451 }
452
453 path = msi_resolve_source_folder(package, folderW, NULL);
454 if (path)
455 r = msi_strncpyWtoA(path, -1, buf, sz, FALSE);
456 else
458
459 free(path);
460 free(folderW);
461 msiobj_release(&package->hdr);
462 return r;
463}
464
465/***********************************************************************
466 * MsiGetSourcePathW (MSI.@)
467 */
469{
470 MSIPACKAGE *package;
471 WCHAR *path;
472 UINT r;
473
474 TRACE("%s %p %p\n", debugstr_w(folder), buf, sz);
475
476 if (!folder)
478
479 package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
480 if (!package)
481 {
482 WCHAR *path = NULL;
483 MSIHANDLE remote;
484
485 if (!(remote = msi_get_remote(hinst)))
487
488 __TRY
489 {
490 r = remote_GetSourcePath(remote, folder, &path);
491 }
493 {
495 }
497
498 if (!r)
499 r = msi_strncpyW(path, -1, buf, sz);
500
502 return r;
503 }
504
506 if (path)
507 r = msi_strncpyW(path, -1, buf, sz);
508 else
510
511 free(path);
512 msiobj_release(&package->hdr);
513 return r;
514}
515
516/***********************************************************************
517 * MsiSetTargetPathA (MSI.@)
518 */
520 LPCSTR szFolderPath )
521{
522 LPWSTR szwFolder = NULL, szwFolderPath = NULL;
524
525 if ( !szFolder || !szFolderPath )
527
528 szwFolder = strdupAtoW(szFolder);
529 szwFolderPath = strdupAtoW(szFolderPath);
530 if (!szwFolder || !szwFolderPath)
531 goto end;
532
533 rc = MsiSetTargetPathW( hInstall, szwFolder, szwFolderPath );
534
535end:
536 free(szwFolder);
537 free(szwFolderPath);
538
539 return rc;
540}
541
542static void set_target_path( MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path )
543{
544 FolderList *fl;
546 WCHAR *target_path;
547
548 if (!(target_path = msi_normalize_path( path ))) return;
549 if (wcscmp( target_path, folder->ResolvedTarget ))
550 {
551 free( folder->ResolvedTarget );
552 folder->ResolvedTarget = target_path;
553 msi_set_property( package->db, folder->Directory, folder->ResolvedTarget, -1 );
554
556 {
557 child = fl->folder;
558 msi_resolve_target_folder( package, child->Directory, FALSE );
559 }
560 }
561 else free( target_path );
562}
563
564UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath )
565{
566 DWORD attrib;
568 MSIFILE *file;
569
570 TRACE("%p %s %s\n", package, debugstr_w(szFolder), debugstr_w(szFolderPath));
571
572 attrib = msi_get_file_attributes( package, szFolderPath );
573 /* native MSI tests writeability by making temporary files at each drive */
574 if (attrib != INVALID_FILE_ATTRIBUTES &&
575 (attrib & FILE_ATTRIBUTE_OFFLINE || attrib & FILE_ATTRIBUTE_READONLY))
576 {
578 }
579 if (!(folder = msi_get_loaded_folder( package, szFolder ))) return ERROR_DIRECTORY;
580
581 set_target_path( package, folder, szFolderPath );
582
584 {
585 const WCHAR *dir;
586 MSICOMPONENT *comp = file->Component;
587
588 if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
589
590 dir = msi_get_target_folder( package, comp->Directory );
591 free( file->TargetPath );
592 file->TargetPath = msi_build_directory_name( 2, dir, file->FileName );
593 }
594 return ERROR_SUCCESS;
595}
596
597/***********************************************************************
598 * MsiSetTargetPathW (MSI.@)
599 */
601 LPCWSTR szFolderPath)
602{
603 MSIPACKAGE *package;
604 UINT ret;
605
606 TRACE("%s %s\n",debugstr_w(szFolder),debugstr_w(szFolderPath));
607
608 if ( !szFolder || !szFolderPath )
610
611 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
612 if (!package)
613 {
614 MSIHANDLE remote;
615
616 if (!(remote = msi_get_remote(hInstall)))
618
619 __TRY
620 {
621 ret = remote_SetTargetPath(remote, szFolder, szFolderPath);
622 }
624 {
626 }
628
629 return ret;
630 }
631
632 ret = MSI_SetTargetPathW( package, szFolder, szFolderPath );
633 msiobj_release( &package->hdr );
634 return ret;
635}
636
637/***********************************************************************
638 * MsiGetMode (MSI.@)
639 *
640 * Returns an internal installer state (if it is running in a mode iRunMode)
641 *
642 * PARAMS
643 * hInstall [I] Handle to the installation
644 * hRunMode [I] Checking run mode
645 * MSIRUNMODE_ADMIN Administrative mode
646 * MSIRUNMODE_ADVERTISE Advertisement mode
647 * MSIRUNMODE_MAINTENANCE Maintenance mode
648 * MSIRUNMODE_ROLLBACKENABLED Rollback is enabled
649 * MSIRUNMODE_LOGENABLED Log file is writing
650 * MSIRUNMODE_OPERATIONS Operations in progress??
651 * MSIRUNMODE_REBOOTATEND We need to reboot after installation completed
652 * MSIRUNMODE_REBOOTNOW We need to reboot to continue the installation
653 * MSIRUNMODE_CABINET Files from cabinet are installed
654 * MSIRUNMODE_SOURCESHORTNAMES Long names in source files is suppressed
655 * MSIRUNMODE_TARGETSHORTNAMES Long names in destination files is suppressed
656 * MSIRUNMODE_RESERVED11 Reserved
657 * MSIRUNMODE_WINDOWS9X Running under Windows95/98
658 * MSIRUNMODE_ZAWENABLED Demand installation is supported
659 * MSIRUNMODE_RESERVED14 Reserved
660 * MSIRUNMODE_RESERVED15 Reserved
661 * MSIRUNMODE_SCHEDULED called from install script
662 * MSIRUNMODE_ROLLBACK called from rollback script
663 * MSIRUNMODE_COMMIT called from commit script
664 *
665 * RETURNS
666 * In the state: TRUE
667 * Not in the state: FALSE
668 *
669 */
671{
672 MSIPACKAGE *package;
673 BOOL r = FALSE;
674
675 TRACE( "%lu, %d\n", hInstall, iRunMode );
676
677 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
678 if (!package)
679 {
680 MSIHANDLE remote;
681
682 if (!(remote = msi_get_remote(hInstall)))
683 return FALSE;
684
685 __TRY
686 {
687 r = remote_GetMode(remote, iRunMode);
688 }
690 {
691 r = FALSE;
692 }
694
695 return r;
696 }
697
698 switch (iRunMode)
699 {
700 case MSIRUNMODE_ADMIN:
701 FIXME("no support for administrative installs\n");
702 break;
703
705 FIXME("no support for advertised installs\n");
706 break;
707
709 if (GetVersion() & 0x80000000)
710 r = TRUE;
711 break;
712
717 break;
718
720 r = package->scheduled_action_running;
721 break;
722
724 r = package->rollback_action_running;
725 break;
726
728 r = package->commit_action_running;
729 break;
730
732 r = msi_get_property_int( package->db, L"Installed", 0 ) != 0;
733 break;
734
736 r = msi_get_property_int( package->db, L"RollbackDisabled", 0 ) == 0;
737 break;
738
740 r = package->need_reboot_at_end;
741 break;
742
744 r = package->need_reboot_now;
745 break;
746
748 r = (package->log_file != INVALID_HANDLE_VALUE);
749 break;
750
751 default:
752 FIXME("unimplemented run mode: %d\n", iRunMode);
753 r = TRUE;
754 }
755
756 msiobj_release( &package->hdr );
757 return r;
758}
759
760/***********************************************************************
761 * MsiSetMode (MSI.@)
762 */
763UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
764{
765 MSIPACKAGE *package;
766 UINT r;
767
768 TRACE( "%lu, %d, %d\n", hInstall, iRunMode, fState );
769
770 package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
771 if (!package)
772 {
773 MSIHANDLE remote;
774
775 if (!(remote = msi_get_remote(hInstall)))
776 return FALSE;
777
778 __TRY
779 {
780 r = remote_SetMode(remote, iRunMode, fState);
781 }
783 {
785 }
787
788 return r;
789 }
790
791 switch (iRunMode)
792 {
794 package->need_reboot_at_end = (fState != 0);
796 break;
797
799 package->need_reboot_now = (fState != 0);
801 break;
802
803 default:
805 }
806
807 msiobj_release( &package->hdr );
808 return r;
809}
810
811/***********************************************************************
812 * MsiSetFeatureStateA (MSI.@)
813 *
814 * According to the docs, when this is called it immediately recalculates
815 * all the component states as well
816 */
818 INSTALLSTATE iState)
819{
820 LPWSTR szwFeature = NULL;
821 UINT rc;
822
823 szwFeature = strdupAtoW(szFeature);
824
825 rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
826
827 free(szwFeature);
828
829 return rc;
830}
831
832/* update component state based on a feature change */
834{
835 INSTALLSTATE newstate;
836 ComponentList *cl;
837
838 newstate = feature->ActionRequest;
839 if (newstate == INSTALLSTATE_ABSENT) newstate = INSTALLSTATE_UNKNOWN;
840
842 {
844
845 if (!component->Enabled) continue;
846
847 TRACE("Modifying (%d): Component %s (Installed %d, Action %d, Request %d)\n",
848 newstate, debugstr_w(component->Component), component->Installed,
849 component->Action, component->ActionRequest);
850
851 if (newstate == INSTALLSTATE_LOCAL)
852 {
854 component->ActionRequest = INSTALLSTATE_LOCAL;
855 }
856 else
857 {
858 ComponentList *clist;
859 MSIFEATURE *f;
860
861 component->hasLocalFeature = FALSE;
862
863 component->Action = newstate;
864 component->ActionRequest = newstate;
865 /* if any other feature wants it local we need to set it local */
867 {
868 if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
869 f->ActionRequest != INSTALLSTATE_SOURCE )
870 {
871 continue;
872 }
873 LIST_FOR_EACH_ENTRY(clist, &f->Components, ComponentList, entry)
874 {
875 if (clist->component == component &&
876 (f->ActionRequest == INSTALLSTATE_LOCAL ||
877 f->ActionRequest == INSTALLSTATE_SOURCE))
878 {
879 TRACE("Saved by %s\n", debugstr_w(f->Feature));
880 component->hasLocalFeature = TRUE;
881
883 {
884 if (f->Attributes & msidbFeatureAttributesFavorSource)
885 {
887 component->ActionRequest = INSTALLSTATE_SOURCE;
888 }
889 else
890 {
892 component->ActionRequest = INSTALLSTATE_LOCAL;
893 }
894 }
895 else if (component->Attributes & msidbComponentAttributesSourceOnly)
896 {
898 component->ActionRequest = INSTALLSTATE_SOURCE;
899 }
900 else
901 {
903 component->ActionRequest = INSTALLSTATE_LOCAL;
904 }
905 }
906 }
907 }
908 }
909 TRACE("Result (%d): Component %s (Installed %d, Action %d, Request %d)\n",
910 newstate, debugstr_w(component->Component), component->Installed,
911 component->Action, component->ActionRequest);
912 }
913}
914
916{
917 UINT rc = ERROR_SUCCESS;
919
920 TRACE("%s %i\n", debugstr_w(szFeature), iState);
921
922 feature = msi_get_loaded_feature( package, szFeature );
923 if (!feature)
925
926 if (iState == INSTALLSTATE_ADVERTISED &&
928 {
929 TRACE("Advertising is disallowed; making feature absent\n");
930 iState = INSTALLSTATE_ABSENT;
931 }
932
933 feature->ActionRequest = iState;
934
936
937 /* update all the features that are children of this feature */
939 {
940 if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
941 MSI_SetFeatureStateW(package, child->Feature, iState);
942 }
943
944 return rc;
945}
946
947/***********************************************************************
948 * MsiSetFeatureStateW (MSI.@)
949 */
951 INSTALLSTATE iState)
952{
953 MSIPACKAGE* package;
954 UINT rc = ERROR_SUCCESS;
955
956 TRACE("%s %i\n",debugstr_w(szFeature), iState);
957
958 if (!szFeature)
960
961 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
962 if (!package)
963 {
964 MSIHANDLE remote;
965
966 if (!(remote = msi_get_remote(hInstall)))
968
969 __TRY
970 {
971 rc = remote_SetFeatureState(remote, szFeature, iState);
972 }
974 {
975 rc = GetExceptionCode();
976 }
978
979 return rc;
980 }
981
982 rc = MSI_SetFeatureStateW(package,szFeature,iState);
983
984 msiobj_release( &package->hdr );
985 return rc;
986}
987
988/***********************************************************************
989* MsiSetFeatureAttributesA (MSI.@)
990*/
992{
993 UINT r;
994 WCHAR *featureW = NULL;
995
996 TRACE( "%lu, %s, %#lx\n", handle, debugstr_a(feature), attrs );
997
998 if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
999
1000 r = MsiSetFeatureAttributesW( handle, featureW, attrs );
1001 free( featureW );
1002 return r;
1003}
1004
1006{
1007 DWORD ret = 0;
1008
1015 return ret;
1016}
1017
1018/***********************************************************************
1019* MsiSetFeatureAttributesW (MSI.@)
1020*/
1022{
1023 MSIPACKAGE *package;
1025 WCHAR *costing;
1026
1027 TRACE( "%lu, %s, %#lx\n", handle, debugstr_w(name), attrs );
1028
1029 if (!name || !name[0]) return ERROR_UNKNOWN_FEATURE;
1030
1031 if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1032 return ERROR_INVALID_HANDLE;
1033
1034 costing = msi_dup_property( package->db, L"CostingComplete" );
1035 if (!costing || !wcscmp( costing, L"1" ))
1036 {
1037 free( costing );
1038 msiobj_release( &package->hdr );
1039 return ERROR_FUNCTION_FAILED;
1040 }
1041 free( costing );
1042 if (!(feature = msi_get_loaded_feature( package, name )))
1043 {
1044 msiobj_release( &package->hdr );
1045 return ERROR_UNKNOWN_FEATURE;
1046 }
1047 feature->Attributes = unmap_feature_attributes( attrs );
1048 msiobj_release( &package->hdr );
1049 return ERROR_SUCCESS;
1050}
1051
1052/***********************************************************************
1053* MsiGetFeatureStateA (MSI.@)
1054*/
1056 INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
1057{
1058 LPWSTR szwFeature = NULL;
1059 UINT rc;
1060
1061 if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY;
1062
1063 rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction);
1064 free(szwFeature);
1065 return rc;
1066}
1067
1069 INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
1070{
1072
1073 feature = msi_get_loaded_feature(package,szFeature);
1074 if (!feature)
1075 return ERROR_UNKNOWN_FEATURE;
1076
1077 if (piInstalled)
1078 *piInstalled = feature->Installed;
1079
1080 if (piAction)
1081 *piAction = feature->ActionRequest;
1082
1083 TRACE("returning %i %i\n", feature->Installed, feature->ActionRequest);
1084
1085 return ERROR_SUCCESS;
1086}
1087
1088/***********************************************************************
1089* MsiGetFeatureStateW (MSI.@)
1090*/
1091UINT WINAPI MsiGetFeatureStateW( MSIHANDLE hInstall, const WCHAR *szFeature, INSTALLSTATE *piInstalled,
1092 INSTALLSTATE *piAction )
1093{
1094 MSIPACKAGE* package;
1095 UINT ret;
1096
1097 TRACE( "%lu, %s, %p, %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction );
1098
1099 if (!szFeature)
1100 return ERROR_UNKNOWN_FEATURE;
1101
1102 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1103 if (!package)
1104 {
1105 MSIHANDLE remote;
1106
1107 if (!(remote = msi_get_remote(hInstall)))
1108 return ERROR_INVALID_HANDLE;
1109
1110 __TRY
1111 {
1112 ret = remote_GetFeatureState(remote, szFeature, piInstalled, piAction);
1113 }
1115 {
1117 }
1118 __ENDTRY
1119
1120 return ret;
1121 }
1122
1123 ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction);
1124 msiobj_release( &package->hdr );
1125 return ret;
1126}
1127
1128/***********************************************************************
1129* MsiGetFeatureCostA (MSI.@)
1130*/
1132 MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
1133{
1134 LPWSTR szwFeature = NULL;
1135 UINT rc;
1136
1137 szwFeature = strdupAtoW(szFeature);
1138
1139 rc = MsiGetFeatureCostW(hInstall, szwFeature, iCostTree, iState, piCost);
1140
1141 free(szwFeature);
1142
1143 return rc;
1144}
1145
1147{
1148 INT cost = 0;
1149 ComponentList *cl;
1150
1151 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1152 {
1153 cost += cl->component->cost;
1154 }
1155 return cost;
1156}
1157
1159 INSTALLSTATE state, LPINT cost )
1160{
1161 TRACE("%s, %u, %d, %p\n", debugstr_w(feature->Feature), tree, state, cost);
1162
1163 *cost = 0;
1164 switch (tree)
1165 {
1167 {
1169
1171 {
1172 if (child->ActionRequest == state)
1173 *cost += feature_cost( child );
1174 }
1175 break;
1176 }
1178 {
1179 const WCHAR *feature_parent = feature->Feature_Parent;
1180 for (;;)
1181 {
1182 MSIFEATURE *parent = msi_get_loaded_feature( package, feature_parent );
1183 if (!parent)
1184 break;
1185
1186 if (parent->ActionRequest == state)
1187 *cost += feature_cost( parent );
1188
1189 feature_parent = parent->Feature_Parent;
1190 }
1191 break;
1192 }
1194 if (feature->ActionRequest == state)
1195 *cost = feature_cost( feature );
1196 break;
1197
1198 default:
1199 WARN("unhandled cost tree %u\n", tree);
1200 break;
1201 }
1202
1203 return ERROR_SUCCESS;
1204}
1205
1206/***********************************************************************
1207* MsiGetFeatureCostW (MSI.@)
1208*/
1209UINT WINAPI MsiGetFeatureCostW( MSIHANDLE hInstall, const WCHAR *szFeature, MSICOSTTREE iCostTree,
1210 INSTALLSTATE iState, INT *piCost )
1211{
1212 MSIPACKAGE *package;
1214 UINT ret;
1215
1216 TRACE( "%lu, %s, %d, %d, %p\n", hInstall, debugstr_w(szFeature), iCostTree, iState, piCost );
1217
1218 if (!szFeature)
1220
1221 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1222 if (!package)
1223 {
1224 MSIHANDLE remote;
1225
1226 if (!(remote = msi_get_remote(hInstall)))
1227 return ERROR_INVALID_HANDLE;
1228
1229 __TRY
1230 {
1231 ret = remote_GetFeatureCost(remote, szFeature, iCostTree, iState, piCost);
1232 }
1234 {
1236 }
1237 __ENDTRY
1238
1239 return ret;
1240 }
1241
1242 if (!piCost)
1243 {
1244 msiobj_release( &package->hdr );
1246 }
1247
1248 feature = msi_get_loaded_feature(package, szFeature);
1249
1250 if (feature)
1251 ret = MSI_GetFeatureCost(package, feature, iCostTree, iState, piCost);
1252 else
1254
1255 msiobj_release( &package->hdr );
1256 return ret;
1257}
1258
1259/***********************************************************************
1260* MsiGetFeatureInfoA (MSI.@)
1261*/
1263 char *title, DWORD *title_len, char *help, DWORD *help_len )
1264{
1265 UINT r;
1266 WCHAR *titleW = NULL, *helpW = NULL, *featureW = NULL;
1267
1268 TRACE( "%lu, %s, %p, %p, %p, %p, %p\n", handle, debugstr_a(feature), attrs, title,
1269 title_len, help, help_len );
1270
1271 if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
1272
1273 if (title && title_len && !(titleW = malloc( *title_len * sizeof(WCHAR) )))
1274 {
1275 free( featureW );
1276 return ERROR_OUTOFMEMORY;
1277 }
1278 if (help && help_len && !(helpW = malloc( *help_len * sizeof(WCHAR) )))
1279 {
1280 free( featureW );
1281 free( titleW );
1282 return ERROR_OUTOFMEMORY;
1283 }
1284 r = MsiGetFeatureInfoW( handle, featureW, attrs, titleW, title_len, helpW, help_len );
1285 if (r == ERROR_SUCCESS)
1286 {
1287 if (titleW) WideCharToMultiByte( CP_ACP, 0, titleW, -1, title, *title_len + 1, NULL, NULL );
1288 if (helpW) WideCharToMultiByte( CP_ACP, 0, helpW, -1, help, *help_len + 1, NULL, NULL );
1289 }
1290 free( titleW );
1291 free( helpW );
1292 free( featureW );
1293 return r;
1294}
1295
1297{
1298 DWORD ret = 0;
1299
1306 return ret;
1307}
1308
1310 LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len )
1311{
1314 int len;
1315
1316 if (!feature) return ERROR_UNKNOWN_FEATURE;
1317 if (attrs) *attrs = map_feature_attributes( feature->Attributes );
1318 if (title_len)
1319 {
1320 if (feature->Title) len = lstrlenW( feature->Title );
1321 else len = 0;
1322 if (*title_len <= len)
1323 {
1324 *title_len = len;
1325 if (title) r = ERROR_MORE_DATA;
1326 }
1327 else if (title)
1328 {
1329 if (feature->Title) lstrcpyW( title, feature->Title );
1330 else *title = 0;
1331 *title_len = len;
1332 }
1333 }
1334 if (help_len)
1335 {
1336 if (feature->Description) len = lstrlenW( feature->Description );
1337 else len = 0;
1338 if (*help_len <= len)
1339 {
1340 *help_len = len;
1341 if (help) r = ERROR_MORE_DATA;
1342 }
1343 else if (help)
1344 {
1345 if (feature->Description) lstrcpyW( help, feature->Description );
1346 else *help = 0;
1347 *help_len = len;
1348 }
1349 }
1350 return r;
1351}
1352
1353/***********************************************************************
1354* MsiGetFeatureInfoW (MSI.@)
1355*/
1357 WCHAR *title, DWORD *title_len, WCHAR *help, DWORD *help_len )
1358{
1359 UINT r;
1360 MSIPACKAGE *package;
1361
1362 TRACE( "%lu, %s, %p, %p, %p, %p, %p\n", handle, debugstr_w(feature), attrs, title,
1363 title_len, help, help_len );
1364
1365 if (!feature) return ERROR_INVALID_PARAMETER;
1366
1367 if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1368 return ERROR_INVALID_HANDLE;
1369
1370 /* features may not have been loaded yet */
1371 msi_load_all_components( package );
1372 msi_load_all_features( package );
1373
1374 r = MSI_GetFeatureInfo( package, feature, attrs, title, title_len, help, help_len );
1375 msiobj_release( &package->hdr );
1376 return r;
1377}
1378
1379/***********************************************************************
1380 * MsiSetComponentStateA (MSI.@)
1381 */
1383 INSTALLSTATE iState)
1384{
1385 UINT rc;
1386 LPWSTR szwComponent = strdupAtoW(szComponent);
1387
1388 rc = MsiSetComponentStateW(hInstall, szwComponent, iState);
1389
1390 free(szwComponent);
1391
1392 return rc;
1393}
1394
1395/***********************************************************************
1396 * MsiGetComponentStateA (MSI.@)
1397 */
1399 INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
1400{
1401 LPWSTR szwComponent= NULL;
1402 UINT rc;
1403
1404 szwComponent= strdupAtoW(szComponent);
1405
1406 rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction);
1407
1408 free(szwComponent);
1409
1410 return rc;
1411}
1412
1413static UINT MSI_SetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent,
1414 INSTALLSTATE iState)
1415{
1416 MSICOMPONENT *comp;
1417
1418 TRACE("%p %s %d\n", package, debugstr_w(szComponent), iState);
1419
1420 comp = msi_get_loaded_component(package, szComponent);
1421 if (!comp)
1423
1424 if (comp->Enabled)
1425 comp->Action = iState;
1426
1427 return ERROR_SUCCESS;
1428}
1429
1431 INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
1432{
1433 MSICOMPONENT *comp;
1434
1435 TRACE("%p %s %p %p\n", package, debugstr_w(szComponent),
1436 piInstalled, piAction);
1437
1438 comp = msi_get_loaded_component(package,szComponent);
1439 if (!comp)
1441
1442 if (piInstalled)
1443 {
1444 if (comp->Enabled)
1445 *piInstalled = comp->Installed;
1446 else
1447 *piInstalled = INSTALLSTATE_UNKNOWN;
1448 }
1449
1450 if (piAction)
1451 {
1452 if (comp->Enabled)
1453 *piAction = comp->Action;
1454 else
1455 *piAction = INSTALLSTATE_UNKNOWN;
1456 }
1457
1458 TRACE("states (%i, %i)\n", comp->Installed, comp->Action );
1459 return ERROR_SUCCESS;
1460}
1461
1462/***********************************************************************
1463 * MsiSetComponentStateW (MSI.@)
1464 */
1466 INSTALLSTATE iState)
1467{
1468 MSIPACKAGE* package;
1469 UINT ret;
1470
1471 if (!szComponent)
1473
1474 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1475 if (!package)
1476 {
1477 MSIHANDLE remote;
1478
1479 if (!(remote = msi_get_remote(hInstall)))
1480 return ERROR_INVALID_HANDLE;
1481
1482 __TRY
1483 {
1484 ret = remote_SetComponentState(remote, szComponent, iState);
1485 }
1487 {
1489 }
1490 __ENDTRY
1491
1492 return ret;
1493 }
1494
1495 ret = MSI_SetComponentStateW(package, szComponent, iState);
1496 msiobj_release(&package->hdr);
1497 return ret;
1498}
1499
1500/***********************************************************************
1501 * MsiGetComponentStateW (MSI.@)
1502 */
1503UINT WINAPI MsiGetComponentStateW( MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled,
1504 INSTALLSTATE *piAction )
1505{
1506 MSIPACKAGE* package;
1507 UINT ret;
1508
1509 TRACE( "%lu, %s, %p, %p\n", hInstall, debugstr_w(szComponent), piInstalled, piAction );
1510
1511 if (!szComponent)
1513
1514 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1515 if (!package)
1516 {
1517 MSIHANDLE remote;
1518
1519 if (!(remote = msi_get_remote(hInstall)))
1520 return ERROR_INVALID_HANDLE;
1521
1522 __TRY
1523 {
1524 ret = remote_GetComponentState(remote, szComponent, piInstalled, piAction);
1525 }
1527 {
1529 }
1530 __ENDTRY
1531
1532 return ret;
1533 }
1534
1535 ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction);
1536 msiobj_release( &package->hdr );
1537 return ret;
1538}
1539
1540/***********************************************************************
1541 * MsiGetLanguage (MSI.@)
1542 */
1544{
1545 MSIPACKAGE* package;
1546 LANGID langid;
1547
1548 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1549 if (!package)
1550 {
1551 MSIHANDLE remote;
1552
1553 if (!(remote = msi_get_remote(hInstall)))
1554 return ERROR_INVALID_HANDLE;
1555
1556 __TRY
1557 {
1558 langid = remote_GetLanguage(remote);
1559 }
1561 {
1562 langid = 0;
1563 }
1564 __ENDTRY
1565
1566 return langid;
1567 }
1568
1569 langid = msi_get_property_int( package->db, L"ProductLanguage", 0 );
1570 msiobj_release( &package->hdr );
1571 return langid;
1572}
1573
1574UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
1575{
1576 WCHAR level[6];
1577 int len;
1578 UINT r;
1579
1580 TRACE("%p %i\n", package, iInstallLevel);
1581
1582 if (iInstallLevel > 32767)
1584
1585 if (iInstallLevel < 1)
1586 return MSI_SetFeatureStates( package );
1587
1588 len = swprintf( level, ARRAY_SIZE(level), L"%d", iInstallLevel );
1589 r = msi_set_property( package->db, L"INSTALLLEVEL", level, len );
1590 if ( r == ERROR_SUCCESS )
1591 r = MSI_SetFeatureStates( package );
1592
1593 return r;
1594}
1595
1596/***********************************************************************
1597 * MsiSetInstallLevel (MSI.@)
1598 */
1599UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
1600{
1601 MSIPACKAGE* package;
1602 UINT r;
1603
1604 TRACE( "%lu %d\n", hInstall, iInstallLevel );
1605
1606 package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1607 if (!package)
1608 {
1609 MSIHANDLE remote;
1610
1611 if (!(remote = msi_get_remote(hInstall)))
1612 return ERROR_INVALID_HANDLE;
1613
1614 __TRY
1615 {
1616 r = remote_SetInstallLevel(remote, iInstallLevel);
1617 }
1619 {
1620 r = GetExceptionCode();
1621 }
1622 __ENDTRY
1623
1624 return r;
1625 }
1626
1627 r = MSI_SetInstallLevel( package, iInstallLevel );
1628
1629 msiobj_release( &package->hdr );
1630
1631 return r;
1632}
1633
1634/***********************************************************************
1635 * MsiGetFeatureValidStatesW (MSI.@)
1636 */
1637UINT WINAPI MsiGetFeatureValidStatesW( MSIHANDLE hInstall, const WCHAR *szFeature, DWORD *pInstallState )
1638{
1639 if (pInstallState) *pInstallState = 1 << INSTALLSTATE_LOCAL;
1640 FIXME( "%lu, %s, %p stub returning %lu\n", hInstall, debugstr_w(szFeature), pInstallState,
1641 pInstallState ? *pInstallState : 0 );
1642 return ERROR_SUCCESS;
1643}
1644
1645/***********************************************************************
1646 * MsiGetFeatureValidStatesA (MSI.@)
1647 */
1648UINT WINAPI MsiGetFeatureValidStatesA( MSIHANDLE hInstall, const char *szFeature, DWORD *pInstallState )
1649{
1650 UINT ret;
1651 WCHAR *szwFeature = strdupAtoW(szFeature);
1652 ret = MsiGetFeatureValidStatesW(hInstall, szwFeature, pInstallState);
1653 free(szwFeature);
1654 return ret;
1655}
static int state
Definition: maze.c:121
unsigned int dir
Definition: maze.c:112
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
int help
Definition: sort.c:20
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERROR_MORE_DATA
Definition: dderror.h:13
#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
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: rpc.c:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define __TRY
Definition: compat.h:80
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define __ENDTRY
Definition: compat.h:82
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
UINT msi_load_all_components(MSIPACKAGE *package)
Definition: action.c:806
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2035
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:348
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:582
UINT MSI_Sequence(MSIPACKAGE *package, LPCWSTR table)
Definition: action.c:446
WCHAR * msi_normalize_path(const WCHAR *in)
Definition: action.c:2115
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1638
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:560
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7837
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:549
UINT msi_load_all_features(MSIPACKAGE *package)
Definition: action.c:949
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2183
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2006
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:115
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
Definition: install.c:409
UINT WINAPI MsiSetFeatureAttributesA(MSIHANDLE handle, LPCSTR feature, DWORD attrs)
Definition: install.c:991
static DWORD unmap_feature_attributes(DWORD attrs)
Definition: install.c:1005
UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
Definition: install.c:213
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
Definition: install.c:364
static UINT MSI_GetFeatureInfo(MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs, LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len)
Definition: install.c:1309
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
UINT WINAPI MsiGetFeatureValidStatesW(MSIHANDLE hInstall, const WCHAR *szFeature, DWORD *pInstallState)
Definition: install.c:1637
UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1398
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1465
static void set_target_path(MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path)
Definition: install.c:542
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, const WCHAR *szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, INT *piCost)
Definition: install.c:1209
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1543
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1599
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:950
static INT feature_cost(MSIFEATURE *feature)
Definition: install.c:1146
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:123
static UINT MSI_SetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1413
UINT msi_strncpyWtoA(const WCHAR *str, int lenW, char *buf, DWORD *sz, BOOL remote)
Definition: install.c:190
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:232
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:1091
UINT WINAPI MsiDoActionA(MSIHANDLE hInstall, LPCSTR szAction)
Definition: install.c:45
UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
Definition: install.c:252
UINT WINAPI MsiSequenceA(MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode)
Definition: install.c:104
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:468
UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1430
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:600
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:833
UINT WINAPI MsiGetFeatureInfoA(MSIHANDLE handle, const char *feature, DWORD *attrs, char *title, DWORD *title_len, char *help, DWORD *help_len)
Definition: install.c:1262
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, const WCHAR *szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1503
static WCHAR * get_source_root(MSIPACKAGE *package)
Definition: install.c:358
UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE iState)
Definition: install.c:817
UINT MSI_GetFeatureCost(MSIPACKAGE *package, MSIFEATURE *feature, MSICOSTTREE tree, INSTALLSTATE state, LPINT cost)
Definition: install.c:1158
UINT WINAPI MsiSetTargetPathA(MSIHANDLE hInstall, LPCSTR szFolder, LPCSTR szFolderPath)
Definition: install.c:519
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:763
UINT MSI_GetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1068
UINT WINAPI MsiGetFeatureInfoW(MSIHANDLE handle, const WCHAR *feature, DWORD *attrs, WCHAR *title, DWORD *title_len, WCHAR *help, DWORD *help_len)
Definition: install.c:1356
UINT WINAPI MsiSetFeatureAttributesW(MSIHANDLE handle, LPCWSTR name, DWORD attrs)
Definition: install.c:1021
UINT WINAPI MsiGetFeatureCostA(MSIHANDLE hInstall, LPCSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
Definition: install.c:1131
UINT WINAPI MsiGetFeatureValidStatesA(MSIHANDLE hInstall, const char *szFeature, DWORD *pInstallState)
Definition: install.c:1648
UINT MSI_SetInstallLevel(MSIPACKAGE *package, int iInstallLevel)
Definition: install.c:1574
UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1055
UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1382
static DWORD map_feature_attributes(DWORD attrs)
Definition: install.c:1296
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:158
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:670
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint level
Definition: gl.h:1546
GLuint GLuint end
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLfloat f
Definition: glext.h:7540
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: sysinfo.c:13
static const WCHAR titleW[]
Definition: htmlelem.c:1067
static const WCHAR helpW[]
Definition: htmlevent.c:70
#define GetExceptionCode
Definition: excpt.h:83
uint32_t entry
Definition: isohybrid.c:63
#define f
Definition: ke_i.h:83
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
USHORT LANGID
Definition: mui.h:9
int * LPINT
Definition: minwindef.h:151
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HINSTANCE hinst
Definition: edit.c:551
INTERNETFEATURELIST feature
Definition: misc.c:1807
static HWND child
Definition: cursoricon.c:298
#define min(a, b)
Definition: monoChain.cc:55
LANGID langid
Definition: msctf.idl:626
@ INSTALLFEATUREATTRIBUTE_FAVORSOURCE
Definition: msi.h:222
@ INSTALLFEATUREATTRIBUTE_NOUNSUPPORTEDADVERTISE
Definition: msi.h:226
@ INSTALLFEATUREATTRIBUTE_FAVORLOCAL
Definition: msi.h:221
@ INSTALLFEATUREATTRIBUTE_DISALLOWADVERTISE
Definition: msi.h:225
@ INSTALLFEATUREATTRIBUTE_FAVORADVERTISE
Definition: msi.h:224
@ INSTALLFEATUREATTRIBUTE_FOLLOWPARENT
Definition: msi.h:223
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ INSTALLSTATE_ABSENT
Definition: msi.h:45
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
@ msidbComponentAttributesOptional
Definition: msidefs.h:161
@ msidbComponentAttributesSourceOnly
Definition: msidefs.h:160
@ msidbFeatureAttributesFavorAdvertise
Definition: msidefs.h:151
@ msidbFeatureAttributesFollowParent
Definition: msidefs.h:150
@ msidbFeatureAttributesFavorSource
Definition: msidefs.h:149
@ msidbFeatureAttributesDisallowAdvertise
Definition: msidefs.h:152
@ msidbFeatureAttributesNoUnsupportedAdvertise
Definition: msidefs.h:154
@ msidbFeatureAttributesFavorLocal
Definition: msidefs.h:148
@ msidbSumInfoSourceTypeSFN
Definition: msidefs.h:221
@ msidbSumInfoSourceTypeCompressed
Definition: msidefs.h:222
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2337
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2132
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop) __WINE_DEALLOC(free) __WINE_MALLOC
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:750
@ MSICOSTTREE_PARENTS
Definition: msiquery.h:44
@ MSICOSTTREE_CHILDREN
Definition: msiquery.h:43
@ MSICOSTTREE_SELFONLY
Definition: msiquery.h:42
@ MSIRUNMODE_SCHEDULED
Definition: msiquery.h:99
@ MSIRUNMODE_ADVERTISE
Definition: msiquery.h:84
@ MSIRUNMODE_WINDOWS9X
Definition: msiquery.h:95
@ MSIRUNMODE_RESERVED15
Definition: msiquery.h:98
@ MSIRUNMODE_MAINTENANCE
Definition: msiquery.h:85
@ MSIRUNMODE_RESERVED14
Definition: msiquery.h:97
@ MSIRUNMODE_REBOOTATEND
Definition: msiquery.h:89
@ MSIRUNMODE_REBOOTNOW
Definition: msiquery.h:90
@ MSIRUNMODE_ROLLBACK
Definition: msiquery.h:100
@ MSIRUNMODE_LOGENABLED
Definition: msiquery.h:87
@ MSIRUNMODE_OPERATIONS
Definition: msiquery.h:88
@ MSIRUNMODE_ADMIN
Definition: msiquery.h:83
@ MSIRUNMODE_COMMIT
Definition: msiquery.h:101
@ MSIRUNMODE_RESERVED11
Definition: msiquery.h:94
@ MSIRUNMODE_ROLLBACKENABLED
Definition: msiquery.h:86
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_OFFLINE
Definition: nt_native.h:712
short WCHAR
Definition: pedump.c:58
static char title[]
Definition: ps.c:92
const WCHAR * str
#define midl_user_free
Definition: rpc.h:41
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR w
Definition: msipriv.h:767
LPSTR a
Definition: msipriv.h:766
union awstring::@616 str
BOOL unicode
Definition: msipriv.h:764
Definition: fci.c:123
Definition: fci.c:112
Definition: name.c:39
MSICOMPONENT * component
Definition: msipriv.h:568
INSTALLSTATE Action
Definition: msipriv.h:546
INSTALLSTATE Installed
Definition: msipriv.h:544
LPWSTR Directory
Definition: msipriv.h:540
UINT WordCount
Definition: msipriv.h:472
unsigned char commit_action_running
Definition: msipriv.h:481
struct list features
Definition: msipriv.h:415
MSIOBJECTHDR hdr
Definition: msipriv.h:406
struct list files
Definition: msipriv.h:416
MSIDATABASE * db
Definition: msipriv.h:407
unsigned char rollback_action_running
Definition: msipriv.h:482
HANDLE log_file
Definition: msipriv.h:428
unsigned char scheduled_action_running
Definition: msipriv.h:480
unsigned char need_reboot_now
Definition: msipriv.h:484
unsigned char need_reboot_at_end
Definition: msipriv.h:483
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_In_ FLONG fl
Definition: winddi.h:1279
#define WINAPI
Definition: msvc.h:6
#define __EXCEPT(func)
Definition: exception.h:62
int MSIRUNMODE
Definition: winemsi.idl:30
int MSICOSTTREE
Definition: winemsi.idl:34
unsigned long MSIHANDLE
Definition: winemsi.idl:27
int INSTALLSTATE
Definition: winemsi.idl:31
#define ERROR_DIRECTORY
Definition: winerror.h:416
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:1313
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:1312
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333