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
];
34 WCHAR Description
[0x100];
37 WCHAR Directory
[IDENTIFIER_SIZE
];
40 INSTALLSTATE Installed
;
41 INSTALLSTATE ActionRequest
;
44 struct list Components
;
49 typedef struct tagMSICOMPONENT
53 WCHAR Component
[IDENTIFIER_SIZE
];
54 WCHAR ComponentId
[IDENTIFIER_SIZE
];
55 WCHAR Directory
[IDENTIFIER_SIZE
];
57 WCHAR Condition
[0x100];
58 WCHAR KeyPath
[IDENTIFIER_SIZE
];
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 tagMSIAPPID
125 WCHAR AppID
[IDENTIFIER_SIZE
]; /* Primary key */
126 LPWSTR RemoteServerName
;
128 LPWSTR ServiceParameters
;
130 BOOL ActivateAtStorage
;
131 BOOL RunAsInteractiveUser
;
134 typedef struct tagMSICLASS
137 WCHAR CLSID
[IDENTIFIER_SIZE
]; /* Primary Key */
138 WCHAR Context
[IDENTIFIER_SIZE
]; /* Primary Key */
139 MSICOMPONENT
*Component
;
146 LPWSTR DefInprocHandler
;
147 LPWSTR DefInprocHandler32
;
151 /* not in the table, set during installation */
155 typedef struct tagMSIMIME MSIMIME
;
157 typedef struct tagMSIEXTENSION
159 WCHAR Extension
[256]; /* Primary Key */
160 MSICOMPONENT
*Component
;
165 /* not in the table, set during installation */
168 INT Verbs
[100]; /* yes hard coded limit, but realistically 100 verbs??? */
171 typedef struct tagMSIPROGID
173 LPWSTR ProgID
; /* Primary Key */
178 /* not in the table, set during installation */
184 typedef struct tagMSIVERB
196 LPWSTR ContentType
; /* Primary Key */
198 WCHAR CLSID
[IDENTIFIER_SIZE
];
200 /* not in the table, set during installation */
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
;
222 LPWSTR
*UniqueActions
;
223 UINT UniqueActionsCount
;
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
);
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
,
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__ */