- build a standard Wine list of components instead of using an array
[wine/dcerpc.git] / dlls / msi / action.h
blobbabdcce2d76ee33990a3d5b6ffc69209863f57dc
1 /*
2 * Common prototypes for Action handlers
4 * Copyright 2005 Aric Stewart for CodeWeavers
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.
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.
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
21 #include "wine/list.h"
23 #define IDENTIFIER_SIZE 96
25 typedef struct tagMSIFEATURE
27 WCHAR Feature[IDENTIFIER_SIZE];
28 WCHAR Feature_Parent[IDENTIFIER_SIZE];
29 WCHAR Title[0x100];
30 WCHAR Description[0x100];
31 INT Display;
32 INT Level;
33 WCHAR Directory[IDENTIFIER_SIZE];
34 INT Attributes;
36 INSTALLSTATE Installed;
37 INSTALLSTATE ActionRequest;
38 INSTALLSTATE Action;
40 struct list *Components;
42 INT Cost;
43 } MSIFEATURE;
45 typedef struct tagMSICOMPONENT
47 struct list entry;
48 DWORD magic;
49 WCHAR Component[IDENTIFIER_SIZE];
50 WCHAR ComponentId[IDENTIFIER_SIZE];
51 WCHAR Directory[IDENTIFIER_SIZE];
52 INT Attributes;
53 WCHAR Condition[0x100];
54 WCHAR KeyPath[IDENTIFIER_SIZE];
56 INSTALLSTATE Installed;
57 INSTALLSTATE ActionRequest;
58 INSTALLSTATE Action;
60 BOOL Enabled;
61 INT Cost;
62 INT RefCount;
64 LPWSTR FullKeypath;
65 LPWSTR AdvertiseString;
66 } MSICOMPONENT;
68 typedef struct tagComponentList
70 struct list entry;
71 MSICOMPONENT *component;
72 } ComponentList;
74 typedef struct tagMSIFOLDER
76 LPWSTR Directory;
77 LPWSTR TargetDefault;
78 LPWSTR SourceDefault;
80 LPWSTR ResolvedTarget;
81 LPWSTR ResolvedSource;
82 LPWSTR Property; /* initially set property */
83 INT ParentIndex;
84 INT State;
85 /* 0 = uninitialized */
86 /* 1 = existing */
87 /* 2 = created remove if empty */
88 /* 3 = created persist if empty */
89 INT Cost;
90 INT Space;
91 }MSIFOLDER;
93 typedef struct tagMSIFILE
95 LPWSTR File;
96 MSICOMPONENT *Component;
97 LPWSTR FileName;
98 LPWSTR ShortName;
99 INT FileSize;
100 LPWSTR Version;
101 LPWSTR Language;
102 INT Attributes;
103 INT Sequence;
105 INT State;
106 /* 0 = uninitialize */
107 /* 1 = not present */
108 /* 2 = present but replace */
109 /* 3 = present do not replace */
110 /* 4 = Installed */
111 LPWSTR SourcePath;
112 LPWSTR TargetPath;
113 BOOL Temporary;
114 }MSIFILE;
116 typedef struct tagMSICLASS
118 WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */
119 WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */
120 MSICOMPONENT *Component;
121 INT ProgIDIndex;
122 LPWSTR ProgIDText;
123 LPWSTR Description;
124 INT AppIDIndex;
125 LPWSTR FileTypeMask;
126 LPWSTR IconPath;
127 LPWSTR DefInprocHandler;
128 LPWSTR DefInprocHandler32;
129 LPWSTR Argument;
130 INT FeatureIndex;
131 INT Attributes;
132 /* not in the table, set during installation */
133 BOOL Installed;
134 } MSICLASS;
136 typedef struct tagMSIEXTENSION
138 WCHAR Extension[256]; /* Primary Key */
139 MSICOMPONENT *Component;
140 INT ProgIDIndex;
141 LPWSTR ProgIDText;
142 INT MIMEIndex;
143 INT FeatureIndex;
144 /* not in the table, set during installation */
145 BOOL Installed;
146 INT VerbCount;
147 INT Verbs[100]; /* yes hard coded limit, but realistically 100 verbs??? */
148 } MSIEXTENSION;
150 typedef struct tagMSIPROGID
152 LPWSTR ProgID; /* Primary Key */
153 INT ParentIndex;
154 INT ClassIndex;
155 LPWSTR Description;
156 LPWSTR IconPath;
157 /* not in the table, set during installation */
158 BOOL InstallMe;
159 INT CurVerIndex;
160 INT VersionIndIndex;
161 } MSIPROGID;
163 typedef struct tagMSIVERB
165 INT ExtensionIndex;
166 LPWSTR Verb;
167 INT Sequence;
168 LPWSTR Command;
169 LPWSTR Argument;
170 } MSIVERB;
172 typedef struct tagMSIMIME
174 LPWSTR ContentType; /* Primary Key */
175 INT ExtensionIndex;
176 WCHAR CLSID[IDENTIFIER_SIZE];
177 INT ClassIndex;
178 /* not in the table, set during installation */
179 BOOL InstallMe;
180 } MSIMIME;
182 typedef struct tagMSIAPPID
184 WCHAR AppID[IDENTIFIER_SIZE]; /* Primary key */
185 LPWSTR RemoteServerName;
186 LPWSTR LocalServer;
187 LPWSTR ServiceParameters;
188 LPWSTR DllSurrogate;
189 BOOL ActivateAtStorage;
190 BOOL RunAsInteractiveUser;
191 } MSIAPPID;
193 enum SCRIPTS {
194 INSTALL_SCRIPT = 0,
195 COMMIT_SCRIPT = 1,
196 ROLLBACK_SCRIPT = 2,
197 TOTAL_SCRIPTS = 3
200 #define SEQUENCE_UI 0x1
201 #define SEQUENCE_EXEC 0x2
202 #define SEQUENCE_INSTALL 0x10
204 typedef struct tagMSISCRIPT
206 LPWSTR *Actions[TOTAL_SCRIPTS];
207 UINT ActionCount[TOTAL_SCRIPTS];
208 BOOL ExecuteSequenceRun;
209 BOOL CurrentlyScripting;
210 UINT InWhatSequence;
211 LPWSTR *UniqueActions;
212 UINT UniqueActionsCount;
213 }MSISCRIPT;
216 UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
217 UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
218 void ACTION_FinishCustomActions( MSIPACKAGE* package);
219 UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
221 /* actions in other modules */
222 UINT ACTION_AppSearch(MSIPACKAGE *package);
223 UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
224 UINT ACTION_InstallFiles(MSIPACKAGE *package);
225 UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
226 UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
227 UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
228 UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
229 UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
232 /* Helpers */
233 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
234 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
235 LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
236 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
237 BOOL set_prop, MSIFOLDER **folder);
238 MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
239 int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
240 int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
241 int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
242 UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
243 UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
244 DWORD build_version_dword(LPCWSTR);
245 LPWSTR build_directory_name(DWORD , ...);
246 BOOL create_full_pathW(const WCHAR *path);
247 BOOL ACTION_VerifyComponentForAction(MSIPACKAGE*, MSICOMPONENT*, INSTALLSTATE);
248 BOOL ACTION_VerifyFeatureForAction(MSIPACKAGE*, INT, INSTALLSTATE);
249 void reduce_to_longfilename(WCHAR*);
250 void reduce_to_shortfilename(WCHAR*);
251 LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
252 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
253 UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
254 BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
255 WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
258 /* control event stuff */
259 VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
260 MSIRECORD *data);
261 VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
262 VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
263 LPCWSTR control, LPCWSTR attribute);
264 VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
265 LPCWSTR control, LPCWSTR attribute );
267 /* User Interface messages from the actions */
268 void ui_progress(MSIPACKAGE *, int, int, int, int);
269 void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
272 /* string consts use a number of places and defined in helpers.c*/
273 extern const WCHAR cszSourceDir[];
274 extern const WCHAR szProductCode[];
275 extern const WCHAR cszRootDrive[];
276 extern const WCHAR cszbs[];