- Implement IPersistFolder2.
[wine] / dlls / msi / action.h
1 /*
2  * Common prototypes for Action handlers
3  *
4  * Copyright 2005 Aric Stewart for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20
21 typedef struct tagMSIFEATURE
22 {
23     WCHAR Feature[96];
24     WCHAR Feature_Parent[96];
25     WCHAR Title[0x100];
26     WCHAR Description[0x100];
27     INT Display;
28     INT Level;
29     WCHAR Directory[96];
30     INT Attributes;
31     
32     INSTALLSTATE Installed;
33     INSTALLSTATE ActionRequest;
34     INSTALLSTATE Action;
35
36     INT ComponentCount;
37     INT Components[1024]; /* yes hardcoded limit.... I am bad */
38     INT Cost;
39 } MSIFEATURE;
40
41 typedef struct tagMSICOMPONENT
42 {
43     WCHAR Component[96];
44     WCHAR ComponentId[96];
45     WCHAR Directory[96];
46     INT Attributes;
47     WCHAR Condition[0x100];
48     WCHAR KeyPath[96];
49
50     INSTALLSTATE Installed;
51     INSTALLSTATE ActionRequest;
52     INSTALLSTATE Action;
53
54     BOOL Enabled;
55     INT  Cost;
56     INT  RefCount;
57
58     LPWSTR FullKeypath;
59 } MSICOMPONENT;
60
61 typedef struct tagMSIFOLDER
62 {
63     LPWSTR Directory;
64     LPWSTR TargetDefault;
65     LPWSTR SourceDefault;
66
67     LPWSTR ResolvedTarget;
68     LPWSTR ResolvedSource;
69     LPWSTR Property;   /* initially set property */
70     INT   ParentIndex;
71     INT   State;
72         /* 0 = uninitialized */
73         /* 1 = existing */
74         /* 2 = created remove if empty */
75         /* 3 = created persist if empty */
76     INT   Cost;
77     INT   Space;
78 }MSIFOLDER;
79
80 typedef struct tagMSIFILE
81 {
82     LPWSTR File;
83     INT ComponentIndex;
84     LPWSTR FileName;
85     INT FileSize;
86     LPWSTR Version;
87     LPWSTR Language;
88     INT Attributes;
89     INT Sequence;   
90
91     INT State;
92        /* 0 = uninitialize */
93        /* 1 = not present */
94        /* 2 = present but replace */
95        /* 3 = present do not replace */
96        /* 4 = Installed */
97     LPWSTR  SourcePath;
98     LPWSTR  TargetPath;
99     BOOL    Temporary; 
100 }MSIFILE;
101
102
103 UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action);
104 UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action);
105 void ACTION_FinishCustomActions( MSIPACKAGE* package);
106 UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, BOOL execute);
107 void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
108 UINT ACTION_AppSearch(MSIPACKAGE *package);
109
110 DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
111 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index);
112 LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc);
113 LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, 
114                       BOOL set_prop, MSIFOLDER **folder);
115 int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component );
116 int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
117 int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
118 int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);