2005-01-25 21:17:09 +01:00
|
|
|
/*
|
|
|
|
* Common prototypes for Action handlers
|
|
|
|
*
|
|
|
|
* Copyright 2005 Aric Stewart for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2005-08-24 12:57:02 +02:00
|
|
|
#ifndef __MSI_ACTION_H__
|
|
|
|
#define __MSI_ACTION_H__
|
|
|
|
|
2005-08-19 12:03:11 +02:00
|
|
|
#include "wine/list.h"
|
|
|
|
|
2005-01-25 21:17:09 +01:00
|
|
|
typedef struct tagMSIFEATURE
|
|
|
|
{
|
2005-08-22 16:09:17 +02:00
|
|
|
struct list entry;
|
2005-09-13 12:37:37 +02:00
|
|
|
LPWSTR Feature;
|
|
|
|
LPWSTR Feature_Parent;
|
2005-09-08 14:42:31 +02:00
|
|
|
LPWSTR Title;
|
|
|
|
LPWSTR Description;
|
2005-01-25 21:17:09 +01:00
|
|
|
INT Display;
|
|
|
|
INT Level;
|
2005-09-13 12:37:37 +02:00
|
|
|
LPWSTR Directory;
|
2005-01-25 21:17:09 +01:00
|
|
|
INT Attributes;
|
|
|
|
|
|
|
|
INSTALLSTATE Installed;
|
|
|
|
INSTALLSTATE ActionRequest;
|
|
|
|
INSTALLSTATE Action;
|
|
|
|
|
2005-08-22 16:09:17 +02:00
|
|
|
struct list Components;
|
2005-08-19 12:03:11 +02:00
|
|
|
|
2005-01-25 21:17:09 +01:00
|
|
|
INT Cost;
|
|
|
|
} MSIFEATURE;
|
|
|
|
|
|
|
|
typedef struct tagMSICOMPONENT
|
|
|
|
{
|
2005-08-22 11:15:23 +02:00
|
|
|
struct list entry;
|
|
|
|
DWORD magic;
|
2005-09-12 14:07:15 +02:00
|
|
|
LPWSTR Component;
|
|
|
|
LPWSTR ComponentId;
|
|
|
|
LPWSTR Directory;
|
2005-01-25 21:17:09 +01:00
|
|
|
INT Attributes;
|
2005-09-06 13:39:01 +02:00
|
|
|
LPWSTR Condition;
|
2005-09-12 14:07:15 +02:00
|
|
|
LPWSTR KeyPath;
|
2005-01-25 21:17:09 +01:00
|
|
|
|
|
|
|
INSTALLSTATE Installed;
|
|
|
|
INSTALLSTATE ActionRequest;
|
|
|
|
INSTALLSTATE Action;
|
|
|
|
|
|
|
|
BOOL Enabled;
|
|
|
|
INT Cost;
|
2005-02-24 13:47:43 +01:00
|
|
|
INT RefCount;
|
|
|
|
|
|
|
|
LPWSTR FullKeypath;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR AdvertiseString;
|
2005-01-25 21:17:09 +01:00
|
|
|
} MSICOMPONENT;
|
|
|
|
|
2005-08-19 12:03:11 +02:00
|
|
|
typedef struct tagComponentList
|
|
|
|
{
|
|
|
|
struct list entry;
|
2005-08-22 11:15:23 +02:00
|
|
|
MSICOMPONENT *component;
|
2005-08-19 12:03:11 +02:00
|
|
|
} ComponentList;
|
|
|
|
|
2005-01-25 21:17:09 +01:00
|
|
|
typedef struct tagMSIFOLDER
|
|
|
|
{
|
2005-08-23 20:15:44 +02:00
|
|
|
struct list entry;
|
2005-01-25 21:17:09 +01:00
|
|
|
LPWSTR Directory;
|
|
|
|
LPWSTR TargetDefault;
|
|
|
|
LPWSTR SourceDefault;
|
|
|
|
|
|
|
|
LPWSTR ResolvedTarget;
|
|
|
|
LPWSTR ResolvedSource;
|
|
|
|
LPWSTR Property; /* initially set property */
|
2005-08-23 20:15:44 +02:00
|
|
|
struct tagMSIFOLDER *Parent;
|
2005-01-25 21:17:09 +01:00
|
|
|
INT State;
|
|
|
|
/* 0 = uninitialized */
|
|
|
|
/* 1 = existing */
|
|
|
|
/* 2 = created remove if empty */
|
|
|
|
/* 3 = created persist if empty */
|
|
|
|
INT Cost;
|
|
|
|
INT Space;
|
2005-08-23 20:15:44 +02:00
|
|
|
} MSIFOLDER;
|
2005-01-25 21:17:09 +01:00
|
|
|
|
|
|
|
typedef struct tagMSIFILE
|
|
|
|
{
|
2005-08-23 12:03:17 +02:00
|
|
|
struct list entry;
|
2005-01-25 21:17:09 +01:00
|
|
|
LPWSTR File;
|
2005-08-22 11:15:23 +02:00
|
|
|
MSICOMPONENT *Component;
|
2005-01-25 21:17:09 +01:00
|
|
|
LPWSTR FileName;
|
2005-05-18 15:23:52 +02:00
|
|
|
LPWSTR ShortName;
|
2005-01-25 21:17:09 +01:00
|
|
|
INT FileSize;
|
|
|
|
LPWSTR Version;
|
|
|
|
LPWSTR Language;
|
|
|
|
INT Attributes;
|
|
|
|
INT Sequence;
|
|
|
|
|
|
|
|
INT State;
|
|
|
|
/* 0 = uninitialize */
|
|
|
|
/* 1 = not present */
|
|
|
|
/* 2 = present but replace */
|
|
|
|
/* 3 = present do not replace */
|
|
|
|
/* 4 = Installed */
|
2005-09-07 13:25:18 +02:00
|
|
|
/* 5 = Skipped */
|
2005-01-25 21:17:09 +01:00
|
|
|
LPWSTR SourcePath;
|
|
|
|
LPWSTR TargetPath;
|
2005-08-24 11:45:18 +02:00
|
|
|
} MSIFILE;
|
|
|
|
|
2005-09-07 13:25:18 +02:00
|
|
|
typedef struct tagMSITEMPFILE
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR File;
|
|
|
|
LPWSTR Path;
|
|
|
|
} MSITEMPFILE;
|
|
|
|
|
2005-08-24 11:45:18 +02:00
|
|
|
typedef struct tagMSIAPPID
|
|
|
|
{
|
|
|
|
struct list entry;
|
2005-09-12 17:28:00 +02:00
|
|
|
LPWSTR AppID; /* Primary key */
|
2005-08-24 11:45:18 +02:00
|
|
|
LPWSTR RemoteServerName;
|
|
|
|
LPWSTR LocalServer;
|
|
|
|
LPWSTR ServiceParameters;
|
|
|
|
LPWSTR DllSurrogate;
|
|
|
|
BOOL ActivateAtStorage;
|
|
|
|
BOOL RunAsInteractiveUser;
|
|
|
|
} MSIAPPID;
|
2005-01-25 21:17:09 +01:00
|
|
|
|
2005-09-06 11:26:18 +02:00
|
|
|
typedef struct tagMSIPROGID MSIPROGID;
|
|
|
|
|
2005-05-26 14:24:28 +02:00
|
|
|
typedef struct tagMSICLASS
|
|
|
|
{
|
2005-08-25 12:22:32 +02:00
|
|
|
struct list entry;
|
2005-09-12 17:28:00 +02:00
|
|
|
LPWSTR clsid; /* Primary Key */
|
|
|
|
LPWSTR Context; /* Primary Key */
|
2005-08-22 11:15:23 +02:00
|
|
|
MSICOMPONENT *Component;
|
2005-09-06 11:26:18 +02:00
|
|
|
MSIPROGID *ProgID;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR ProgIDText;
|
|
|
|
LPWSTR Description;
|
2005-08-24 11:45:18 +02:00
|
|
|
MSIAPPID *AppID;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR FileTypeMask;
|
|
|
|
LPWSTR IconPath;
|
|
|
|
LPWSTR DefInprocHandler;
|
|
|
|
LPWSTR DefInprocHandler32;
|
|
|
|
LPWSTR Argument;
|
2005-08-22 16:09:17 +02:00
|
|
|
MSIFEATURE *Feature;
|
2005-05-26 14:24:28 +02:00
|
|
|
INT Attributes;
|
2005-05-30 11:56:56 +02:00
|
|
|
/* not in the table, set during installation */
|
2005-05-26 14:24:28 +02:00
|
|
|
BOOL Installed;
|
|
|
|
} MSICLASS;
|
|
|
|
|
2005-08-26 10:47:31 +02:00
|
|
|
typedef struct tagMSIMIME MSIMIME;
|
|
|
|
|
2005-05-26 14:24:28 +02:00
|
|
|
typedef struct tagMSIEXTENSION
|
|
|
|
{
|
2005-08-29 11:38:39 +02:00
|
|
|
struct list entry;
|
2005-09-09 16:49:08 +02:00
|
|
|
LPWSTR Extension; /* Primary Key */
|
2005-08-22 11:15:23 +02:00
|
|
|
MSICOMPONENT *Component;
|
2005-09-06 11:26:18 +02:00
|
|
|
MSIPROGID *ProgID;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR ProgIDText;
|
2005-08-26 10:47:31 +02:00
|
|
|
MSIMIME *Mime;
|
2005-08-22 16:09:17 +02:00
|
|
|
MSIFEATURE *Feature;
|
2005-05-30 11:56:56 +02:00
|
|
|
/* not in the table, set during installation */
|
2005-05-26 14:24:28 +02:00
|
|
|
BOOL Installed;
|
2005-09-02 16:39:13 +02:00
|
|
|
struct list verbs;
|
2005-05-26 14:24:28 +02:00
|
|
|
} MSIEXTENSION;
|
|
|
|
|
2005-09-06 11:26:18 +02:00
|
|
|
struct tagMSIPROGID
|
2005-05-26 14:24:28 +02:00
|
|
|
{
|
2005-09-06 11:26:18 +02:00
|
|
|
struct list entry;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR ProgID; /* Primary Key */
|
2005-09-06 11:26:18 +02:00
|
|
|
MSIPROGID *Parent;
|
2005-08-25 12:22:32 +02:00
|
|
|
MSICLASS *Class;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR Description;
|
|
|
|
LPWSTR IconPath;
|
2005-05-30 11:56:56 +02:00
|
|
|
/* not in the table, set during installation */
|
2005-05-26 14:24:28 +02:00
|
|
|
BOOL InstallMe;
|
2005-09-06 11:26:18 +02:00
|
|
|
MSIPROGID *CurVer;
|
|
|
|
MSIPROGID *VersionInd;
|
|
|
|
};
|
2005-05-26 14:24:28 +02:00
|
|
|
|
|
|
|
typedef struct tagMSIVERB
|
|
|
|
{
|
2005-09-02 16:39:13 +02:00
|
|
|
struct list entry;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR Verb;
|
|
|
|
INT Sequence;
|
|
|
|
LPWSTR Command;
|
|
|
|
LPWSTR Argument;
|
|
|
|
} MSIVERB;
|
|
|
|
|
2005-08-26 10:47:31 +02:00
|
|
|
struct tagMSIMIME
|
2005-05-26 14:24:28 +02:00
|
|
|
{
|
2005-08-26 10:47:31 +02:00
|
|
|
struct list entry;
|
2005-05-26 14:24:28 +02:00
|
|
|
LPWSTR ContentType; /* Primary Key */
|
2005-08-29 11:38:39 +02:00
|
|
|
MSIEXTENSION *Extension;
|
2005-09-12 17:28:00 +02:00
|
|
|
LPWSTR clsid;
|
2005-08-25 12:22:32 +02:00
|
|
|
MSICLASS *Class;
|
2005-05-30 11:56:56 +02:00
|
|
|
/* not in the table, set during installation */
|
2005-05-26 14:24:28 +02:00
|
|
|
BOOL InstallMe;
|
2005-08-26 10:47:31 +02:00
|
|
|
};
|
2005-05-26 14:24:28 +02:00
|
|
|
|
2005-05-27 21:24:22 +02:00
|
|
|
enum SCRIPTS {
|
|
|
|
INSTALL_SCRIPT = 0,
|
|
|
|
COMMIT_SCRIPT = 1,
|
|
|
|
ROLLBACK_SCRIPT = 2,
|
|
|
|
TOTAL_SCRIPTS = 3
|
|
|
|
};
|
|
|
|
|
2005-06-30 22:45:43 +02:00
|
|
|
#define SEQUENCE_UI 0x1
|
|
|
|
#define SEQUENCE_EXEC 0x2
|
|
|
|
#define SEQUENCE_INSTALL 0x10
|
|
|
|
|
2005-05-27 21:24:22 +02:00
|
|
|
typedef struct tagMSISCRIPT
|
|
|
|
{
|
|
|
|
LPWSTR *Actions[TOTAL_SCRIPTS];
|
|
|
|
UINT ActionCount[TOTAL_SCRIPTS];
|
|
|
|
BOOL ExecuteSequenceRun;
|
|
|
|
BOOL CurrentlyScripting;
|
2005-06-30 22:45:43 +02:00
|
|
|
UINT InWhatSequence;
|
|
|
|
LPWSTR *UniqueActions;
|
|
|
|
UINT UniqueActionsCount;
|
2005-08-24 12:57:02 +02:00
|
|
|
} MSISCRIPT;
|
2005-05-27 21:24:22 +02:00
|
|
|
|
2005-01-25 21:17:09 +01:00
|
|
|
|
2005-08-24 12:57:02 +02:00
|
|
|
extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force);
|
|
|
|
extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
|
|
|
|
extern void ACTION_FinishCustomActions( MSIPACKAGE* package);
|
|
|
|
extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
|
2005-06-16 17:51:44 +02:00
|
|
|
|
|
|
|
/* actions in other modules */
|
2005-08-24 12:57:02 +02:00
|
|
|
extern UINT ACTION_AppSearch(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
|
|
|
|
extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
|
2005-01-25 21:17:09 +01:00
|
|
|
|
2005-06-15 21:12:42 +02:00
|
|
|
|
|
|
|
/* Helpers */
|
2005-08-24 12:57:02 +02:00
|
|
|
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
|
|
|
|
extern WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
|
2005-09-15 17:04:08 +02:00
|
|
|
extern LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop);
|
2005-08-24 12:57:02 +02:00
|
|
|
extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
|
2005-01-25 21:17:09 +01:00
|
|
|
BOOL set_prop, MSIFOLDER **folder);
|
2005-08-24 12:57:02 +02:00
|
|
|
extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
|
|
|
|
extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
|
|
|
|
extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
|
|
|
|
extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
|
|
|
|
extern int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
|
|
|
|
extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
|
2005-09-22 12:33:57 +02:00
|
|
|
extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
|
2005-08-24 12:57:02 +02:00
|
|
|
extern DWORD build_version_dword(LPCWSTR);
|
|
|
|
extern LPWSTR build_directory_name(DWORD , ...);
|
|
|
|
extern BOOL create_full_pathW(const WCHAR *path);
|
|
|
|
extern BOOL ACTION_VerifyComponentForAction(MSIPACKAGE*, MSICOMPONENT*, INSTALLSTATE);
|
|
|
|
extern BOOL ACTION_VerifyFeatureForAction(MSIFEATURE*, INSTALLSTATE);
|
|
|
|
extern void reduce_to_longfilename(WCHAR*);
|
|
|
|
extern void reduce_to_shortfilename(WCHAR*);
|
|
|
|
extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
|
|
|
|
extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
|
|
|
|
extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
|
|
|
|
extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
|
|
|
|
extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
|
2005-06-15 21:12:42 +02:00
|
|
|
|
2005-05-27 11:11:18 +02:00
|
|
|
|
|
|
|
/* control event stuff */
|
2005-08-24 12:57:02 +02:00
|
|
|
extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
|
2005-05-27 11:11:18 +02:00
|
|
|
MSIRECORD *data);
|
2005-08-24 12:57:02 +02:00
|
|
|
extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
|
|
|
|
extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, LPCWSTR event,
|
2005-06-04 11:48:47 +02:00
|
|
|
LPCWSTR control, LPCWSTR attribute);
|
2005-08-24 12:57:02 +02:00
|
|
|
extern VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event,
|
2005-06-07 22:29:51 +02:00
|
|
|
LPCWSTR control, LPCWSTR attribute );
|
2005-06-09 14:05:27 +02:00
|
|
|
|
2005-06-15 21:12:42 +02:00
|
|
|
/* User Interface messages from the actions */
|
2005-08-24 12:57:02 +02:00
|
|
|
extern void ui_progress(MSIPACKAGE *, int, int, int, int);
|
|
|
|
extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
|
2005-06-15 21:12:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* string consts use a number of places and defined in helpers.c*/
|
|
|
|
extern const WCHAR cszSourceDir[];
|
|
|
|
extern const WCHAR szProductCode[];
|
|
|
|
extern const WCHAR cszRootDrive[];
|
2005-06-17 22:56:55 +02:00
|
|
|
extern const WCHAR cszbs[];
|
2005-08-24 12:57:02 +02:00
|
|
|
|
|
|
|
#endif /* __MSI_ACTION_H__ */
|