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 #ifndef __MSI_ACTION_H__
22 #define __MSI_ACTION_H__
24 #include "wine/list.h"
26 #define IDENTIFIER_SIZE 96
28 typedef struct tagMSIFEATURE
31 WCHAR Feature[IDENTIFIER_SIZE];
32 WCHAR Feature_Parent[IDENTIFIER_SIZE];
37 WCHAR Directory[IDENTIFIER_SIZE];
40 INSTALLSTATE Installed;
41 INSTALLSTATE ActionRequest;
44 struct list Components;
49 typedef struct tagMSICOMPONENT
60 INSTALLSTATE Installed;
61 INSTALLSTATE ActionRequest;
69 LPWSTR AdvertiseString;
72 typedef struct tagComponentList
75 MSICOMPONENT *component;
78 typedef struct tagMSIFOLDER
85 LPWSTR ResolvedTarget;
86 LPWSTR ResolvedSource;
87 LPWSTR Property; /* initially set property */
88 struct tagMSIFOLDER *Parent;
90 /* 0 = uninitialized */
92 /* 2 = created remove if empty */
93 /* 3 = created persist if empty */
98 typedef struct tagMSIFILE
102 MSICOMPONENT *Component;
112 /* 0 = uninitialize */
113 /* 1 = not present */
114 /* 2 = present but replace */
115 /* 3 = present do not replace */
122 typedef struct tagMSITEMPFILE
129 typedef struct tagMSIAPPID
132 WCHAR AppID[IDENTIFIER_SIZE]; /* Primary key */
133 LPWSTR RemoteServerName;
135 LPWSTR ServiceParameters;
137 BOOL ActivateAtStorage;
138 BOOL RunAsInteractiveUser;
141 typedef struct tagMSIPROGID MSIPROGID;
143 typedef struct tagMSICLASS
146 WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */
147 WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */
148 MSICOMPONENT *Component;
155 LPWSTR DefInprocHandler;
156 LPWSTR DefInprocHandler32;
160 /* not in the table, set during installation */
164 typedef struct tagMSIMIME MSIMIME;
166 typedef struct tagMSIEXTENSION
169 LPWSTR Extension; /* Primary Key */
170 MSICOMPONENT *Component;
175 /* not in the table, set during installation */
183 LPWSTR ProgID; /* Primary Key */
188 /* not in the table, set during installation */
191 MSIPROGID *VersionInd;
194 typedef struct tagMSIVERB
206 LPWSTR ContentType; /* Primary Key */
207 MSIEXTENSION *Extension;
208 WCHAR CLSID[IDENTIFIER_SIZE];
210 /* not in the table, set during installation */
221 #define SEQUENCE_UI 0x1
222 #define SEQUENCE_EXEC 0x2
223 #define SEQUENCE_INSTALL 0x10
225 typedef struct tagMSISCRIPT
227 LPWSTR *Actions[TOTAL_SCRIPTS];
228 UINT ActionCount[TOTAL_SCRIPTS];
229 BOOL ExecuteSequenceRun;
230 BOOL CurrentlyScripting;
232 LPWSTR *UniqueActions;
233 UINT UniqueActionsCount;
237 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
238 extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
239 extern void ACTION_FinishCustomActions( MSIPACKAGE* package);
240 extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
242 /* actions in other modules */
243 extern UINT ACTION_AppSearch(MSIPACKAGE *package);
244 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
245 extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
246 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
247 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
248 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
249 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
250 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
254 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
255 extern WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
256 extern LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
257 extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
258 BOOL set_prop, MSIFOLDER **folder);
259 extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
260 extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
261 extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
262 extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
263 extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
264 extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
265 extern UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
266 extern DWORD build_version_dword(LPCWSTR);
267 extern LPWSTR build_directory_name(DWORD , ...);
268 extern BOOL create_full_pathW(const WCHAR *path);
269 extern BOOL ACTION_VerifyComponentForAction(MSIPACKAGE*, MSICOMPONENT*, INSTALLSTATE);
270 extern BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
271 extern void reduce_to_longfilename(WCHAR*);
272 extern void reduce_to_shortfilename(WCHAR*);
273 extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
274 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
275 extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
276 extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
277 extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
280 /* control event stuff */
281 extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
283 extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
284 extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
285 LPCWSTR control, LPCWSTR attribute);
286 extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
287 LPCWSTR control, LPCWSTR attribute );
289 /* User Interface messages from the actions */
290 extern void ui_progress(MSIPACKAGE *, int, int, int, int);
291 extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
294 /* string consts use a number of places and defined in helpers.c*/
295 extern const WCHAR cszSourceDir[];
296 extern const WCHAR szProductCode[];
297 extern const WCHAR cszRootDrive[];
298 extern const WCHAR cszbs[];
300 #endif /* __MSI_ACTION_H__ */