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 WCHAR Feature
[IDENTIFIER_SIZE
];
28 WCHAR Feature_Parent
[IDENTIFIER_SIZE
];
30 WCHAR Description
[0x100];
33 WCHAR Directory
[IDENTIFIER_SIZE
];
36 INSTALLSTATE Installed
;
37 INSTALLSTATE ActionRequest
;
40 struct list
*Components
;
45 typedef struct tagMSICOMPONENT
49 WCHAR Component
[IDENTIFIER_SIZE
];
50 WCHAR ComponentId
[IDENTIFIER_SIZE
];
51 WCHAR Directory
[IDENTIFIER_SIZE
];
53 WCHAR Condition
[0x100];
54 WCHAR KeyPath
[IDENTIFIER_SIZE
];
56 INSTALLSTATE Installed
;
57 INSTALLSTATE ActionRequest
;
65 LPWSTR AdvertiseString
;
68 typedef struct tagComponentList
71 MSICOMPONENT
*component
;
74 typedef struct tagMSIFOLDER
80 LPWSTR ResolvedTarget
;
81 LPWSTR ResolvedSource
;
82 LPWSTR Property
; /* initially set property */
85 /* 0 = uninitialized */
87 /* 2 = created remove if empty */
88 /* 3 = created persist if empty */
93 typedef struct tagMSIFILE
96 MSICOMPONENT
*Component
;
106 /* 0 = uninitialize */
107 /* 1 = not present */
108 /* 2 = present but replace */
109 /* 3 = present do not replace */
116 typedef struct tagMSICLASS
118 WCHAR CLSID
[IDENTIFIER_SIZE
]; /* Primary Key */
119 WCHAR Context
[IDENTIFIER_SIZE
]; /* Primary Key */
120 MSICOMPONENT
*Component
;
127 LPWSTR DefInprocHandler
;
128 LPWSTR DefInprocHandler32
;
132 /* not in the table, set during installation */
136 typedef struct tagMSIEXTENSION
138 WCHAR Extension
[256]; /* Primary Key */
139 MSICOMPONENT
*Component
;
144 /* not in the table, set during installation */
147 INT Verbs
[100]; /* yes hard coded limit, but realistically 100 verbs??? */
150 typedef struct tagMSIPROGID
152 LPWSTR ProgID
; /* Primary Key */
157 /* not in the table, set during installation */
163 typedef struct tagMSIVERB
172 typedef struct tagMSIMIME
174 LPWSTR ContentType
; /* Primary Key */
176 WCHAR CLSID
[IDENTIFIER_SIZE
];
178 /* not in the table, set during installation */
182 typedef struct tagMSIAPPID
184 WCHAR AppID
[IDENTIFIER_SIZE
]; /* Primary key */
185 LPWSTR RemoteServerName
;
187 LPWSTR ServiceParameters
;
189 BOOL ActivateAtStorage
;
190 BOOL RunAsInteractiveUser
;
200 #define SEQUENCE_UI 0x1
201 #define SEQUENCE_EXEC 0x2
202 #define SEQUENCE_INSTALL 0x10
204 typedef struct tagMSISCRIPT
206 LPWSTR
*Actions
[TOTAL_SCRIPTS
];
207 UINT ActionCount
[TOTAL_SCRIPTS
];
208 BOOL ExecuteSequenceRun
;
209 BOOL CurrentlyScripting
;
211 LPWSTR
*UniqueActions
;
212 UINT UniqueActionsCount
;
216 UINT
ACTION_PerformAction(MSIPACKAGE
*package
, const WCHAR
*action
, BOOL force
);
217 UINT
ACTION_PerformUIAction(MSIPACKAGE
*package
, const WCHAR
*action
);
218 void ACTION_FinishCustomActions( MSIPACKAGE
* package
);
219 UINT
ACTION_CustomAction(MSIPACKAGE
*package
,const WCHAR
*action
, BOOL execute
);
221 /* actions in other modules */
222 UINT
ACTION_AppSearch(MSIPACKAGE
*package
);
223 UINT
ACTION_FindRelatedProducts(MSIPACKAGE
*package
);
224 UINT
ACTION_InstallFiles(MSIPACKAGE
*package
);
225 UINT
ACTION_DuplicateFiles(MSIPACKAGE
*package
);
226 UINT
ACTION_RegisterClassInfo(MSIPACKAGE
*package
);
227 UINT
ACTION_RegisterProgIdInfo(MSIPACKAGE
*package
);
228 UINT
ACTION_RegisterExtensionInfo(MSIPACKAGE
*package
);
229 UINT
ACTION_RegisterMIMEInfo(MSIPACKAGE
*package
);
233 DWORD
deformat_string(MSIPACKAGE
*package
, LPCWSTR ptr
, WCHAR
** data
);
234 WCHAR
*load_dynamic_stringW(MSIRECORD
*row
, INT index
);
235 LPWSTR
load_dynamic_property(MSIPACKAGE
*package
, LPCWSTR prop
, UINT
* rc
);
236 LPWSTR
resolve_folder(MSIPACKAGE
*package
, LPCWSTR name
, BOOL source
,
237 BOOL set_prop
, MSIFOLDER
**folder
);
238 MSICOMPONENT
*get_loaded_component( MSIPACKAGE
* package
, LPCWSTR Component
);
239 int get_loaded_feature(MSIPACKAGE
* package
, LPCWSTR Feature
);
240 int get_loaded_file(MSIPACKAGE
* package
, LPCWSTR file
);
241 int track_tempfile(MSIPACKAGE
*package
, LPCWSTR name
, LPCWSTR path
);
242 UINT
schedule_action(MSIPACKAGE
*package
, UINT script
, LPCWSTR action
);
243 UINT
build_icon_path(MSIPACKAGE
*, LPCWSTR
, LPWSTR
*);
244 DWORD
build_version_dword(LPCWSTR
);
245 LPWSTR
build_directory_name(DWORD
, ...);
246 BOOL
create_full_pathW(const WCHAR
*path
);
247 BOOL
ACTION_VerifyComponentForAction(MSIPACKAGE
*, MSICOMPONENT
*, INSTALLSTATE
);
248 BOOL
ACTION_VerifyFeatureForAction(MSIPACKAGE
*, INT
, INSTALLSTATE
);
249 void reduce_to_longfilename(WCHAR
*);
250 void reduce_to_shortfilename(WCHAR
*);
251 LPWSTR
create_component_advertise_string(MSIPACKAGE
*, MSICOMPONENT
*, LPCWSTR
);
252 void ACTION_UpdateComponentStates(MSIPACKAGE
*package
, LPCWSTR szFeature
);
253 UINT
register_unique_action(MSIPACKAGE
*, LPCWSTR
);
254 BOOL
check_unique_action(MSIPACKAGE
*, LPCWSTR
);
255 WCHAR
* generate_error_string(MSIPACKAGE
*, UINT
, DWORD
, ... );
258 /* control event stuff */
259 VOID
ControlEvent_FireSubscribedEvent(MSIPACKAGE
*package
, LPCWSTR event
,
261 VOID
ControlEvent_CleanupSubscriptions(MSIPACKAGE
*package
);
262 VOID
ControlEvent_SubscribeToEvent(MSIPACKAGE
*package
, LPCWSTR event
,
263 LPCWSTR control
, LPCWSTR attribute
);
264 VOID
ControlEvent_UnSubscribeToEvent( MSIPACKAGE
*package
, LPCWSTR event
,
265 LPCWSTR control
, LPCWSTR attribute
);
267 /* User Interface messages from the actions */
268 void ui_progress(MSIPACKAGE
*, int, int, int, int);
269 void ui_actiondata(MSIPACKAGE
*, LPCWSTR
, MSIRECORD
*);
272 /* string consts use a number of places and defined in helpers.c*/
273 extern const WCHAR cszSourceDir
[];
274 extern const WCHAR szProductCode
[];
275 extern const WCHAR cszRootDrive
[];
276 extern const WCHAR cszbs
[];