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 typedef struct tagMSIFEATURE
24 WCHAR Feature_Parent[96];
26 WCHAR Description[0x100];
32 INSTALLSTATE Installed;
33 INSTALLSTATE ActionRequest;
37 INT Components[1024]; /* yes hardcoded limit.... I am bad */
41 typedef struct tagMSICOMPONENT
44 WCHAR ComponentId[96];
47 WCHAR Condition[0x100];
50 INSTALLSTATE Installed;
51 INSTALLSTATE ActionRequest;
58 typedef struct tagMSIFOLDER
64 LPWSTR ResolvedTarget;
65 LPWSTR ResolvedSource;
66 LPWSTR Property; /* initially set property */
69 /* 0 = uninitialized */
71 /* 2 = created remove if empty */
72 /* 3 = created persist if empty */
77 typedef struct tagMSIFILE
89 /* 0 = uninitialize */
91 /* 2 = present but replace */
92 /* 3 = present do not replace */
100 UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action);
101 void ACTION_FinishCustomActions( MSIPACKAGE* package);
102 UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
103 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
106 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
107 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
108 LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
109 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
110 BOOL set_prop, MSIFOLDER **folder);
111 int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component );
112 int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
113 int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
114 int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
118 inline static char *strdupWtoA( const WCHAR *str )
123 DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL
125 if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
126 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
131 inline static WCHAR *strdupAtoW( const char *str )
136 DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
137 if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
138 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
143 inline static LPWSTR dupstrW(LPCWSTR src)
146 if (!src) return NULL;
147 dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src)+1)*sizeof(WCHAR));