gcc 4.0 warning fixes.
[wine/gsoc_dplay.git] / dlls / msi / action.h
blobdf88d5f8b9ad180cc2a87bb0d4ca42f36d827cd0
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 #ifndef __MSI_ACTION_H__
22 #define __MSI_ACTION_H__
24 #include "wine/list.h"
26 #define IDENTIFIER_SIZE 96
28 typedef struct tagMSIFEATURE
30 struct list entry;
31 WCHAR Feature[IDENTIFIER_SIZE];
32 WCHAR Feature_Parent[IDENTIFIER_SIZE];
33 WCHAR Title[0x100];
34 WCHAR Description[0x100];
35 INT Display;
36 INT Level;
37 WCHAR Directory[IDENTIFIER_SIZE];
38 INT Attributes;
40 INSTALLSTATE Installed;
41 INSTALLSTATE ActionRequest;
42 INSTALLSTATE Action;
44 struct list Components;
46 INT Cost;
47 } MSIFEATURE;
49 typedef struct tagMSICOMPONENT
51 struct list entry;
52 DWORD magic;
53 WCHAR Component[IDENTIFIER_SIZE];
54 WCHAR ComponentId[IDENTIFIER_SIZE];
55 WCHAR Directory[IDENTIFIER_SIZE];
56 INT Attributes;
57 WCHAR Condition[0x100];
58 WCHAR KeyPath[IDENTIFIER_SIZE];
60 INSTALLSTATE Installed;
61 INSTALLSTATE ActionRequest;
62 INSTALLSTATE Action;
64 BOOL Enabled;
65 INT Cost;
66 INT RefCount;
68 LPWSTR FullKeypath;
69 LPWSTR AdvertiseString;
70 } MSICOMPONENT;
72 typedef struct tagComponentList
74 struct list entry;
75 MSICOMPONENT *component;
76 } ComponentList;
78 typedef struct tagMSIFOLDER
80 struct list entry;
81 LPWSTR Directory;
82 LPWSTR TargetDefault;
83 LPWSTR SourceDefault;
85 LPWSTR ResolvedTarget;
86 LPWSTR ResolvedSource;
87 LPWSTR Property; /* initially set property */
88 struct tagMSIFOLDER *Parent;
89 INT State;
90 /* 0 = uninitialized */
91 /* 1 = existing */
92 /* 2 = created remove if empty */
93 /* 3 = created persist if empty */
94 INT Cost;
95 INT Space;
96 } MSIFOLDER;
98 typedef struct tagMSIFILE
100 struct list entry;
101 LPWSTR File;
102 MSICOMPONENT *Component;
103 LPWSTR FileName;
104 LPWSTR ShortName;
105 INT FileSize;
106 LPWSTR Version;
107 LPWSTR Language;
108 INT Attributes;
109 INT Sequence;
111 INT State;
112 /* 0 = uninitialize */
113 /* 1 = not present */
114 /* 2 = present but replace */
115 /* 3 = present do not replace */
116 /* 4 = Installed */
117 LPWSTR SourcePath;
118 LPWSTR TargetPath;
119 BOOL Temporary;
120 } MSIFILE;
122 typedef struct tagMSIAPPID
124 struct list entry;
125 WCHAR AppID[IDENTIFIER_SIZE]; /* Primary key */
126 LPWSTR RemoteServerName;
127 LPWSTR LocalServer;
128 LPWSTR ServiceParameters;
129 LPWSTR DllSurrogate;
130 BOOL ActivateAtStorage;
131 BOOL RunAsInteractiveUser;
132 } MSIAPPID;
134 typedef struct tagMSICLASS
136 struct list entry;
137 WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */
138 WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */
139 MSICOMPONENT *Component;
140 INT ProgIDIndex;
141 LPWSTR ProgIDText;
142 LPWSTR Description;
143 MSIAPPID *AppID;
144 LPWSTR FileTypeMask;
145 LPWSTR IconPath;
146 LPWSTR DefInprocHandler;
147 LPWSTR DefInprocHandler32;
148 LPWSTR Argument;
149 MSIFEATURE *Feature;
150 INT Attributes;
151 /* not in the table, set during installation */
152 BOOL Installed;
153 } MSICLASS;
155 typedef struct tagMSIMIME MSIMIME;
157 typedef struct tagMSIEXTENSION
159 WCHAR Extension[256]; /* Primary Key */
160 MSICOMPONENT *Component;
161 INT ProgIDIndex;
162 LPWSTR ProgIDText;
163 MSIMIME *Mime;
164 MSIFEATURE *Feature;
165 /* not in the table, set during installation */
166 BOOL Installed;
167 INT VerbCount;
168 INT Verbs[100]; /* yes hard coded limit, but realistically 100 verbs??? */
169 } MSIEXTENSION;
171 typedef struct tagMSIPROGID
173 LPWSTR ProgID; /* Primary Key */
174 INT ParentIndex;
175 MSICLASS *Class;
176 LPWSTR Description;
177 LPWSTR IconPath;
178 /* not in the table, set during installation */
179 BOOL InstallMe;
180 INT CurVerIndex;
181 INT VersionIndIndex;
182 } MSIPROGID;
184 typedef struct tagMSIVERB
186 INT ExtensionIndex;
187 LPWSTR Verb;
188 INT Sequence;
189 LPWSTR Command;
190 LPWSTR Argument;
191 } MSIVERB;
193 struct tagMSIMIME
195 struct list entry;
196 LPWSTR ContentType; /* Primary Key */
197 INT ExtensionIndex;
198 WCHAR CLSID[IDENTIFIER_SIZE];
199 MSICLASS *Class;
200 /* not in the table, set during installation */
201 BOOL InstallMe;
204 enum SCRIPTS {
205 INSTALL_SCRIPT = 0,
206 COMMIT_SCRIPT = 1,
207 ROLLBACK_SCRIPT = 2,
208 TOTAL_SCRIPTS = 3
211 #define SEQUENCE_UI 0x1
212 #define SEQUENCE_EXEC 0x2
213 #define SEQUENCE_INSTALL 0x10
215 typedef struct tagMSISCRIPT
217 LPWSTR *Actions[TOTAL_SCRIPTS];
218 UINT ActionCount[TOTAL_SCRIPTS];
219 BOOL ExecuteSequenceRun;
220 BOOL CurrentlyScripting;
221 UINT InWhatSequence;
222 LPWSTR *UniqueActions;
223 UINT UniqueActionsCount;
224 } MSISCRIPT;
227 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
228 extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
229 extern void ACTION_FinishCustomActions( MSIPACKAGE* package);
230 extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
232 /* actions in other modules */
233 extern UINT ACTION_AppSearch(MSIPACKAGE *package);
234 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
235 extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
236 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
237 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
238 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
239 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
240 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
243 /* Helpers */
244 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
245 extern WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
246 extern LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
247 extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
248 BOOL set_prop, MSIFOLDER **folder);
249 extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
250 extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
251 extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
252 extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
253 extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
254 extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
255 extern UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
256 extern DWORD build_version_dword(LPCWSTR);
257 extern LPWSTR build_directory_name(DWORD , ...);
258 extern BOOL create_full_pathW(const WCHAR *path);
259 extern BOOL ACTION_VerifyComponentForAction(MSIPACKAGE*, MSICOMPONENT*, INSTALLSTATE);
260 extern BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
261 extern void reduce_to_longfilename(WCHAR*);
262 extern void reduce_to_shortfilename(WCHAR*);
263 extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
264 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
265 extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
266 extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
267 extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
270 /* control event stuff */
271 extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
272 MSIRECORD *data);
273 extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
274 extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
275 LPCWSTR control, LPCWSTR attribute);
276 extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
277 LPCWSTR control, LPCWSTR attribute );
279 /* User Interface messages from the actions */
280 extern void ui_progress(MSIPACKAGE *, int, int, int, int);
281 extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
284 /* string consts use a number of places and defined in helpers.c*/
285 extern const WCHAR cszSourceDir[];
286 extern const WCHAR szProductCode[];
287 extern const WCHAR cszRootDrive[];
288 extern const WCHAR cszbs[];
290 #endif /* __MSI_ACTION_H__ */