- build a standard Wine list of files instead of using an array
[wine/gsoc_dplay.git] / dlls / msi / action.h
blobabdadecf29fcea635a1467315575e0f0e15580a2
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 struct list entry;
97 LPWSTR File;
98 MSICOMPONENT *Component;
99 LPWSTR FileName;
100 LPWSTR ShortName;
101 INT FileSize;
102 LPWSTR Version;
103 LPWSTR Language;
104 INT Attributes;
105 INT Sequence;
107 INT State;
108 /* 0 = uninitialize */
109 /* 1 = not present */
110 /* 2 = present but replace */
111 /* 3 = present do not replace */
112 /* 4 = Installed */
113 LPWSTR SourcePath;
114 LPWSTR TargetPath;
115 BOOL Temporary;
116 }MSIFILE;
118 typedef struct tagMSICLASS
120 WCHAR CLSID[IDENTIFIER_SIZE]; /* Primary Key */
121 WCHAR Context[IDENTIFIER_SIZE]; /* Primary Key */
122 MSICOMPONENT *Component;
123 INT ProgIDIndex;
124 LPWSTR ProgIDText;
125 LPWSTR Description;
126 INT AppIDIndex;
127 LPWSTR FileTypeMask;
128 LPWSTR IconPath;
129 LPWSTR DefInprocHandler;
130 LPWSTR DefInprocHandler32;
131 LPWSTR Argument;
132 MSIFEATURE *Feature;
133 INT Attributes;
134 /* not in the table, set during installation */
135 BOOL Installed;
136 } MSICLASS;
138 typedef struct tagMSIEXTENSION
140 WCHAR Extension[256]; /* Primary Key */
141 MSICOMPONENT *Component;
142 INT ProgIDIndex;
143 LPWSTR ProgIDText;
144 INT MIMEIndex;
145 MSIFEATURE *Feature;
146 /* not in the table, set during installation */
147 BOOL Installed;
148 INT VerbCount;
149 INT Verbs[100]; /* yes hard coded limit, but realistically 100 verbs??? */
150 } MSIEXTENSION;
152 typedef struct tagMSIPROGID
154 LPWSTR ProgID; /* Primary Key */
155 INT ParentIndex;
156 INT ClassIndex;
157 LPWSTR Description;
158 LPWSTR IconPath;
159 /* not in the table, set during installation */
160 BOOL InstallMe;
161 INT CurVerIndex;
162 INT VersionIndIndex;
163 } MSIPROGID;
165 typedef struct tagMSIVERB
167 INT ExtensionIndex;
168 LPWSTR Verb;
169 INT Sequence;
170 LPWSTR Command;
171 LPWSTR Argument;
172 } MSIVERB;
174 typedef struct tagMSIMIME
176 LPWSTR ContentType; /* Primary Key */
177 INT ExtensionIndex;
178 WCHAR CLSID[IDENTIFIER_SIZE];
179 INT ClassIndex;
180 /* not in the table, set during installation */
181 BOOL InstallMe;
182 } MSIMIME;
184 typedef struct tagMSIAPPID
186 WCHAR AppID[IDENTIFIER_SIZE]; /* Primary key */
187 LPWSTR RemoteServerName;
188 LPWSTR LocalServer;
189 LPWSTR ServiceParameters;
190 LPWSTR DllSurrogate;
191 BOOL ActivateAtStorage;
192 BOOL RunAsInteractiveUser;
193 } MSIAPPID;
195 enum SCRIPTS {
196 INSTALL_SCRIPT = 0,
197 COMMIT_SCRIPT = 1,
198 ROLLBACK_SCRIPT = 2,
199 TOTAL_SCRIPTS = 3
202 #define SEQUENCE_UI 0x1
203 #define SEQUENCE_EXEC 0x2
204 #define SEQUENCE_INSTALL 0x10
206 typedef struct tagMSISCRIPT
208 LPWSTR *Actions[TOTAL_SCRIPTS];
209 UINT ActionCount[TOTAL_SCRIPTS];
210 BOOL ExecuteSequenceRun;
211 BOOL CurrentlyScripting;
212 UINT InWhatSequence;
213 LPWSTR *UniqueActions;
214 UINT UniqueActionsCount;
215 }MSISCRIPT;
218 UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
219 UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
220 void ACTION_FinishCustomActions( MSIPACKAGE* package);
221 UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
223 /* actions in other modules */
224 UINT ACTION_AppSearch(MSIPACKAGE *package);
225 UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
226 UINT ACTION_InstallFiles(MSIPACKAGE *package);
227 UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
228 UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
229 UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
230 UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
231 UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
234 /* Helpers */
235 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
236 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
237 LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
238 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
239 BOOL set_prop, MSIFOLDER **folder);
240 MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
241 MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
242 MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
243 int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
244 UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
245 UINT build_icon_path(MSIPACKAGE *, LPCWSTR, LPWSTR *);
246 DWORD build_version_dword(LPCWSTR);
247 LPWSTR build_directory_name(DWORD , ...);
248 BOOL create_full_pathW(const WCHAR *path);
249 BOOL ACTION_VerifyComponentForAction(MSIPACKAGE*, MSICOMPONENT*, INSTALLSTATE);
250 BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
251 void reduce_to_longfilename(WCHAR*);
252 void reduce_to_shortfilename(WCHAR*);
253 LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
254 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
255 UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
256 BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
257 WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
260 /* control event stuff */
261 VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
262 MSIRECORD *data);
263 VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
264 VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
265 LPCWSTR control, LPCWSTR attribute);
266 VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
267 LPCWSTR control, LPCWSTR attribute );
269 /* User Interface messages from the actions */
270 void ui_progress(MSIPACKAGE *, int, int, int, int);
271 void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
274 /* string consts use a number of places and defined in helpers.c*/
275 extern const WCHAR cszSourceDir[];
276 extern const WCHAR szProductCode[];
277 extern const WCHAR cszRootDrive[];
278 extern const WCHAR cszbs[];