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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __MSI_ACTION_H__
22 #define __MSI_ACTION_H__
24 #include "wine/list.h"
26 typedef struct tagMSIFEATURE
30 LPWSTR Feature_Parent;
38 INSTALLSTATE Installed;
39 INSTALLSTATE ActionRequest;
42 struct list Components;
47 typedef struct tagMSICOMPONENT
58 INSTALLSTATE Installed;
59 INSTALLSTATE ActionRequest;
68 LPWSTR AdvertiseString;
71 typedef struct tagComponentList
74 MSICOMPONENT *component;
77 typedef struct tagMSIFOLDER
82 LPWSTR SourceLongPath;
83 LPWSTR SourceShortPath;
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 enum _msi_file_state {
107 typedef struct tagMSIFILE
111 MSICOMPONENT *Component;
120 msi_file_state state;
126 typedef struct tagMSITEMPFILE
133 typedef struct tagMSIAPPID
136 LPWSTR AppID; /* Primary key */
137 LPWSTR RemoteServerName;
139 LPWSTR ServiceParameters;
141 BOOL ActivateAtStorage;
142 BOOL RunAsInteractiveUser;
145 typedef struct tagMSIPROGID MSIPROGID;
147 typedef struct tagMSICLASS
150 LPWSTR clsid; /* Primary Key */
151 LPWSTR Context; /* Primary Key */
152 MSICOMPONENT *Component;
159 LPWSTR DefInprocHandler;
160 LPWSTR DefInprocHandler32;
164 /* not in the table, set during installation */
168 typedef struct tagMSIMIME MSIMIME;
170 typedef struct tagMSIEXTENSION
173 LPWSTR Extension; /* Primary Key */
174 MSICOMPONENT *Component;
179 /* not in the table, set during installation */
187 LPWSTR ProgID; /* Primary Key */
192 /* not in the table, set during installation */
195 MSIPROGID *VersionInd;
198 typedef struct tagMSIVERB
210 LPWSTR ContentType; /* Primary Key */
211 MSIEXTENSION *Extension;
214 /* not in the table, set during installation */
225 #define SEQUENCE_UI 0x1
226 #define SEQUENCE_EXEC 0x2
227 #define SEQUENCE_INSTALL 0x10
229 typedef struct tagMSISCRIPT
231 LPWSTR *Actions[TOTAL_SCRIPTS];
232 UINT ActionCount[TOTAL_SCRIPTS];
233 BOOL ExecuteSequenceRun;
234 BOOL CurrentlyScripting;
236 LPWSTR *UniqueActions;
237 UINT UniqueActionsCount;
241 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
242 extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
243 extern void ACTION_FinishCustomActions( MSIPACKAGE* package);
244 extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
246 /* actions in other modules */
247 extern UINT ACTION_AppSearch(MSIPACKAGE *package);
248 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
249 extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
250 extern UINT ACTION_RemoveFiles(MSIPACKAGE *package);
251 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
252 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
253 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
254 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
255 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
259 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
260 extern LPWSTR msi_dup_record_field(MSIRECORD *row, INT index);
261 extern LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop);
262 extern int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def );
263 extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
264 BOOL set_prop, MSIFOLDER **folder);
265 extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
266 extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
267 extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
268 extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
269 extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
270 extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
271 extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
272 extern LPWSTR build_directory_name(DWORD , ...);
273 extern BOOL create_full_pathW(const WCHAR *path);
274 extern BOOL ACTION_VerifyComponentForAction(MSICOMPONENT*, INSTALLSTATE);
275 extern BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
276 extern void reduce_to_longfilename(WCHAR*);
277 extern void reduce_to_shortfilename(WCHAR*);
278 extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
279 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
280 extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
281 extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
282 extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
283 extern UINT msi_create_component_directories( MSIPACKAGE *package );
286 /* control event stuff */
287 extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
289 extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
290 extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
291 LPCWSTR control, LPCWSTR attribute);
292 extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
293 LPCWSTR control, LPCWSTR attribute );
295 /* User Interface messages from the actions */
296 extern void ui_progress(MSIPACKAGE *, int, int, int, int);
297 extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
300 /* string consts use a number of places and defined in helpers.c*/
301 extern const WCHAR cszSourceDir[];
302 extern const WCHAR szProductCode[];
303 extern const WCHAR cszRootDrive[];
304 extern const WCHAR cszbs[];
306 #endif /* __MSI_ACTION_H__ */