Sync to Wine-20050524:
[reactos.git] / reactos / lib / msi / action.h
1 /*
2 * Common prototypes for Action handlers
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 typedef struct tagMSIFEATURE
22 {
23 WCHAR Feature[96];
24 WCHAR Feature_Parent[96];
25 WCHAR Title[0x100];
26 WCHAR Description[0x100];
27 INT Display;
28 INT Level;
29 WCHAR Directory[96];
30 INT Attributes;
31
32 INSTALLSTATE Installed;
33 INSTALLSTATE ActionRequest;
34 INSTALLSTATE Action;
35
36 INT ComponentCount;
37 INT Components[1024]; /* yes hardcoded limit.... I am bad */
38 INT Cost;
39 } MSIFEATURE;
40
41 typedef struct tagMSICOMPONENT
42 {
43 WCHAR Component[96];
44 WCHAR ComponentId[96];
45 WCHAR Directory[96];
46 INT Attributes;
47 WCHAR Condition[0x100];
48 WCHAR KeyPath[96];
49
50 INSTALLSTATE Installed;
51 INSTALLSTATE ActionRequest;
52 INSTALLSTATE Action;
53
54 BOOL Enabled;
55 INT Cost;
56 INT RefCount;
57
58 LPWSTR FullKeypath;
59 } MSICOMPONENT;
60
61 typedef struct tagMSIFOLDER
62 {
63 LPWSTR Directory;
64 LPWSTR TargetDefault;
65 LPWSTR SourceDefault;
66
67 LPWSTR ResolvedTarget;
68 LPWSTR ResolvedSource;
69 LPWSTR Property; /* initially set property */
70 INT ParentIndex;
71 INT State;
72 /* 0 = uninitialized */
73 /* 1 = existing */
74 /* 2 = created remove if empty */
75 /* 3 = created persist if empty */
76 INT Cost;
77 INT Space;
78 }MSIFOLDER;
79
80 typedef struct tagMSIFILE
81 {
82 LPWSTR File;
83 INT ComponentIndex;
84 LPWSTR FileName;
85 LPWSTR ShortName;
86 INT FileSize;
87 LPWSTR Version;
88 LPWSTR Language;
89 INT Attributes;
90 INT Sequence;
91
92 INT State;
93 /* 0 = uninitialize */
94 /* 1 = not present */
95 /* 2 = present but replace */
96 /* 3 = present do not replace */
97 /* 4 = Installed */
98 LPWSTR SourcePath;
99 LPWSTR TargetPath;
100 BOOL Temporary;
101 }MSIFILE;
102
103
104 UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action);
105 UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
106 void ACTION_FinishCustomActions( MSIPACKAGE* package);
107 UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
108 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
109 UINT ACTION_AppSearch(MSIPACKAGE *package);
110
111 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
112 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
113 LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
114 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
115 BOOL set_prop, MSIFOLDER **folder);
116 int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component );
117 int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
118 int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
119 int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);