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 #define IDENTIFIER_SIZE 96
23 typedef struct tagMSIFEATURE
25 WCHAR Feature
[IDENTIFIER_SIZE
];
26 WCHAR Feature_Parent
[IDENTIFIER_SIZE
];
28 WCHAR Description
[0x100];
31 WCHAR Directory
[IDENTIFIER_SIZE
];
34 INSTALLSTATE Installed
;
35 INSTALLSTATE ActionRequest
;
39 INT Components
[1024]; /* yes hardcoded limit.... I am bad */
43 typedef struct tagMSICOMPONENT
45 WCHAR Component
[IDENTIFIER_SIZE
];
46 WCHAR ComponentId
[IDENTIFIER_SIZE
];
47 WCHAR Directory
[IDENTIFIER_SIZE
];
49 WCHAR Condition
[0x100];
50 WCHAR KeyPath
[IDENTIFIER_SIZE
];
52 INSTALLSTATE Installed
;
53 INSTALLSTATE ActionRequest
;
61 LPWSTR AdvertiseString
;
64 typedef struct tagMSIFOLDER
70 LPWSTR ResolvedTarget
;
71 LPWSTR ResolvedSource
;
72 LPWSTR Property
; /* initially set property */
75 /* 0 = uninitialized */
77 /* 2 = created remove if empty */
78 /* 3 = created persist if empty */
83 typedef struct tagMSIFILE
96 /* 0 = uninitialize */
98 /* 2 = present but replace */
99 /* 3 = present do not replace */
106 typedef struct tagMSICLASS
108 WCHAR CLSID
[IDENTIFIER_SIZE
]; /* Primary Key */
109 WCHAR Context
[IDENTIFIER_SIZE
]; /* Primary Key */
110 INT ComponentIndex
; /* Primary Key */
117 LPWSTR DefInprocHandler
;
118 LPWSTR DefInprocHandler32
;
122 /* not in the table, set during installation */
126 typedef struct tagMSIEXTENSION
128 WCHAR Extension
[256]; /* Primary Key */
129 INT ComponentIndex
; /* Primary Key */
134 /* not in the table, set during installation */
137 INT Verbs
[100]; /* yes hard coded limit, but realistically 100 verbs??? */
140 typedef struct tagMSIPROGID
142 LPWSTR ProgID
; /* Primary Key */
147 /* not in the table, set during installation */
153 typedef struct tagMSIVERB
162 typedef struct tagMSIMIME
164 LPWSTR ContentType
; /* Primary Key */
166 WCHAR CLSID
[IDENTIFIER_SIZE
];
168 /* not in the table, set during installation */
172 typedef struct tagMSIAPPID
174 WCHAR AppID
[IDENTIFIER_SIZE
]; /* Primary key */
175 LPWSTR RemoteServerName
;
177 LPWSTR ServiceParameters
;
179 BOOL ActivateAtStorage
;
180 BOOL RunAsInteractiveUser
;
190 #define SEQUENCE_UI 0x1
191 #define SEQUENCE_EXEC 0x2
192 #define SEQUENCE_INSTALL 0x10
194 typedef struct tagMSISCRIPT
196 LPWSTR
*Actions
[TOTAL_SCRIPTS
];
197 UINT ActionCount
[TOTAL_SCRIPTS
];
198 BOOL ExecuteSequenceRun
;
199 BOOL CurrentlyScripting
;
201 LPWSTR
*UniqueActions
;
202 UINT UniqueActionsCount
;
206 UINT
ACTION_PerformAction(MSIPACKAGE
*package
, const WCHAR
*action
, BOOL force
);
207 UINT
ACTION_PerformUIAction(MSIPACKAGE
*package
, const WCHAR
*action
);
208 void ACTION_FinishCustomActions( MSIPACKAGE
* package
);
209 UINT
ACTION_CustomAction(MSIPACKAGE
*package
,const WCHAR
*action
, BOOL execute
);
211 /* actions in other modules */
212 UINT
ACTION_AppSearch(MSIPACKAGE
*package
);
213 UINT
ACTION_FindRelatedProducts(MSIPACKAGE
*package
);
214 UINT
ACTION_InstallFiles(MSIPACKAGE
*package
);
215 UINT
ACTION_DuplicateFiles(MSIPACKAGE
*package
);
216 UINT
ACTION_RegisterClassInfo(MSIPACKAGE
*package
);
217 UINT
ACTION_RegisterProgIdInfo(MSIPACKAGE
*package
);
218 UINT
ACTION_RegisterExtensionInfo(MSIPACKAGE
*package
);
219 UINT
ACTION_RegisterMIMEInfo(MSIPACKAGE
*package
);
223 DWORD
deformat_string(MSIPACKAGE
*package
, LPCWSTR ptr
, WCHAR
** data
);
224 WCHAR
*load_dynamic_stringW(MSIRECORD
*row
, INT index
);
225 LPWSTR
load_dynamic_property(MSIPACKAGE
*package
, LPCWSTR prop
, UINT
* rc
);
226 LPWSTR
resolve_folder(MSIPACKAGE
*package
, LPCWSTR name
, BOOL source
,
227 BOOL set_prop
, MSIFOLDER
**folder
);
228 int get_loaded_component(MSIPACKAGE
* package
, LPCWSTR Component
);
229 int get_loaded_feature(MSIPACKAGE
* package
, LPCWSTR Feature
);
230 int get_loaded_file(MSIPACKAGE
* package
, LPCWSTR file
);
231 int track_tempfile(MSIPACKAGE
*package
, LPCWSTR name
, LPCWSTR path
);
232 UINT
schedule_action(MSIPACKAGE
*package
, UINT script
, LPCWSTR action
);
233 UINT
build_icon_path(MSIPACKAGE
*, LPCWSTR
, LPWSTR
*);
234 DWORD
build_version_dword(LPCWSTR
);
235 LPWSTR
build_directory_name(DWORD
, ...);
236 BOOL
create_full_pathW(const WCHAR
*path
);
237 BOOL
ACTION_VerifyComponentForAction(MSIPACKAGE
*, INT
, INSTALLSTATE
);
238 BOOL
ACTION_VerifyFeatureForAction(MSIPACKAGE
*, INT
, INSTALLSTATE
);
239 void reduce_to_longfilename(WCHAR
*);
240 void reduce_to_shortfilename(WCHAR
*);
241 LPWSTR
create_component_advertise_string(MSIPACKAGE
*, MSICOMPONENT
*, LPCWSTR
);
242 void ACTION_UpdateComponentStates(MSIPACKAGE
*package
, LPCWSTR szFeature
);
243 UINT
register_unique_action(MSIPACKAGE
*, LPCWSTR
);
244 BOOL
check_unique_action(MSIPACKAGE
*, LPCWSTR
);
245 WCHAR
* generate_error_string(MSIPACKAGE
*, UINT
, DWORD
, ... );
248 /* control event stuff */
249 VOID
ControlEvent_FireSubscribedEvent(MSIPACKAGE
*package
, LPCWSTR event
,
251 VOID
ControlEvent_CleanupSubscriptions(MSIPACKAGE
*package
);
252 VOID
ControlEvent_SubscribeToEvent(MSIPACKAGE
*package
, LPCWSTR event
,
253 LPCWSTR control
, LPCWSTR attribute
);
254 VOID
ControlEvent_UnSubscribeToEvent( MSIPACKAGE
*package
, LPCWSTR event
,
255 LPCWSTR control
, LPCWSTR attribute
);
257 /* User Interface messages from the actions */
258 void ui_progress(MSIPACKAGE
*, int, int, int, int);
259 void ui_actiondata(MSIPACKAGE
*, LPCWSTR
, MSIRECORD
*);
262 /* string consts use a number of places and defined in helpers.c*/
263 extern const WCHAR cszSourceDir
[];
264 extern const WCHAR szProductCode
[];
265 extern const WCHAR cszRootDrive
[];
266 extern const WCHAR cszbs
[];