Update ooo320-m1
[ooovba.git] / setup_native / source / win32 / customactions / reg4msdoc / msihelper.hxx
blob112640b61951787ccbab00c2977e209fe2309139
1 #ifndef INCLUDED_MSIHELPER_HXX
2 #define INCLUDED_MSIHELPER_HXX
4 #ifdef _MSC_VER
5 #pragma warning(push, 1) /* disable warnings within system headers */
6 #endif
7 #define WIN32_LEAN_AND_MEAN
8 #include <windows.h>
9 #include <msiquery.h>
10 #ifdef _MSC_VER
11 #pragma warning(pop)
12 #endif
14 #include <string>
16 /**
17 Get the value of the named property
19 @param handle
20 [in] a valid msi handle.
22 @param name
23 [in] the name of the property.
25 @param value
26 [out] receives thes value of the property.
28 @returns
29 <TRUE/>if the property was found.
31 bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value);
33 /**
34 Set the value of a binary property which can only
35 have the values "0" or "1" to "1".
37 @param handle
38 [in] a valid msi handle.
40 @param name
41 [in] the name of the property.
43 void SetMsiProp(MSIHANDLE handle, LPCTSTR name);
45 /**
46 Set the value of a binary property which can only
47 have the values "0" or "1" to "0".
49 @param handle
50 [in] a valid msi handle.
52 @param name
53 [in] the name of the property.
55 void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
57 /**
58 Returns whether a certain property is set meaning
59 its value is "1". This method should be used for
60 binary properties whose value can be "0" or "1".
62 @returns
63 <TRUE/>if the value of the specified property is
64 "1" else if the property is not defined or its
65 value is other than "1" <FALSE/> will be returned.
67 bool IsSetMsiProp(MSIHANDLE handle, LPCTSTR name);
69 /**
70 Returns whether a certain property is set meaning
71 its value is not empty. This method should be used for
72 properties, that can have different values.
74 @returns
75 <TRUE/>if the value of the specified property is
76 not empty. If it is empty <FALSE/> will be returned.
78 bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name);
80 /**
81 Query if this is an installation for all user or not.
83 @param handle
84 [in] a valid msi handle.
86 @returns
87 <TRUE/>if this is an all user installation
89 bool IsAllUserInstallation(MSIHANDLE handle);
91 /**
92 Returns the destination folder of the office installation
93 as system path. The returned path contains a final '\'.
95 @param handle
96 [in] a valid msi handle.
98 @returns
99 the destination path of the office installation finalized
100 with a '\'.
102 std::wstring GetOfficeInstallationPath(MSIHANDLE handle);
105 Returns the absolute path of the office executable that
106 will be installed as system path.
108 @param handle
109 [in] a valid msi handle.
111 @returns
112 the absolute system path of the office executable (e.g.
113 (C:\Program Files\StarOffice 8\program\soffice.exe").
115 std::wstring GetOfficeExecutablePath(MSIHANDLE handle);
118 Get the name of the office that will be installed
119 (e.g. StarOffice 8, StarSuite 8, ...).
121 @param handle
122 [in] a valid msi handle.
124 @returns
125 the name of the office product that will be installed.
127 std::wstring GetProductName(MSIHANDLE handle);
130 Determine if the specified module is installed locally.
132 @param handle
133 [in] a valid msi handle.
135 @param name
136 [in] the name of the module.
138 @returns
139 <TRUE/>if the specified module is installed locally.
141 bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
144 Determine if the specified module is selected to be installed
145 locally.
147 @param handle
148 [in] a valid msi handle.
150 @param name
151 [in] the name of the module.
153 @returns
154 <TRUE/>if the specified module is about to be installed locally.
156 bool IsModuleSelectedForInstallation(MSIHANDLE handle, LPCTSTR name);
159 Determine if the specified module which is locally installed is
160 selected for deinstallation.
162 @param handle
163 [in] a valid msi handle.
165 @param name
166 [in] the name of the module.
168 @returns
169 <TRUE/>if the specified module is about to be deinstalled.
171 bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name);
174 Determine whether this is a complete uninstallation or not.
176 @param handle
177 [in] a valid msi handle.
179 @returns
180 <TRUE/>if this is a complete deinstallation.
182 bool IsCompleteDeinstallation(MSIHANDLE handle);
184 #endif