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