Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / win32 / customactions / reg4msdoc / msihelper.hxx
blob483a66986859e3efe888c7f4165c60f72fec8b36
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 #ifndef INCLUDED_MSIHELPER_HXX
3 #define INCLUDED_MSIHELPER_HXX
5 #ifdef _MSC_VER
6 #pragma warning(push, 1) /* disable warnings within system headers */
7 #endif
8 #define WIN32_LEAN_AND_MEAN
9 #include <windows.h>
10 #include <msiquery.h>
11 #ifdef _MSC_VER
12 #pragma warning(pop)
13 #endif
15 #include <string>
17 /**
18 Get the value of the named property
20 @param handle
21 [in] a valid msi handle.
23 @param name
24 [in] the name of the property.
26 @param value
27 [out] receives thes value of the property.
29 @returns
30 <TRUE/>if the property was found.
32 bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value);
34 /**
35 Set the value of a binary property which can only
36 have the values "0" or "1" to "1".
38 @param handle
39 [in] a valid msi handle.
41 @param name
42 [in] the name of the property.
44 void SetMsiProp(MSIHANDLE handle, LPCTSTR name);
46 /**
47 Set the value of a binary property which can only
48 have the values "0" or "1" to "0".
50 @param handle
51 [in] a valid msi handle.
53 @param name
54 [in] the name of the property.
56 void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
58 /**
59 Returns whether a certain property is set meaning
60 its value is "1". This method should be used for
61 binary properties whose value can be "0" or "1".
63 @returns
64 <TRUE/>if the value of the specified property is
65 "1" else if the property is not defined or its
66 value is other than "1" <FALSE/> will be returned.
68 bool IsSetMsiProp(MSIHANDLE handle, LPCTSTR name);
70 /**
71 Returns whether a certain property is set meaning
72 its value is not empty. This method should be used for
73 properties, that can have different values.
75 @returns
76 <TRUE/>if the value of the specified property is
77 not empty. If it is empty <FALSE/> will be returned.
79 bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name);
81 /**
82 Query if this is an installation for all user or not.
84 @param handle
85 [in] a valid msi handle.
87 @returns
88 <TRUE/>if this is an all user installation
90 bool IsAllUserInstallation(MSIHANDLE handle);
92 /**
93 Returns the destination folder of the office installation
94 as system path. The returned path contains a final '\'.
96 @param handle
97 [in] a valid msi handle.
99 @returns
100 the destination path of the office installation finalized
101 with a '\'.
103 std::wstring GetOfficeInstallationPath(MSIHANDLE handle);
106 Returns the absolute path of the office executable that
107 will be installed as system path.
109 @param handle
110 [in] a valid msi handle.
112 @returns
113 the absolute system path of the office executable (e.g.
114 (C:\Program Files\StarOffice 8\program\soffice.exe").
116 std::wstring GetOfficeExecutablePath(MSIHANDLE handle);
119 Get the name of the office that will be installed
120 (e.g. StarOffice 8, StarSuite 8, ...).
122 @param handle
123 [in] a valid msi handle.
125 @returns
126 the name of the office product that will be installed.
128 std::wstring GetProductName(MSIHANDLE handle);
131 Determine if the specified module is installed locally.
133 @param handle
134 [in] a valid msi handle.
136 @param name
137 [in] the name of the module.
139 @returns
140 <TRUE/>if the specified module is installed locally.
142 bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
145 Determine if the specified module is selected to be installed
146 locally.
148 @param handle
149 [in] a valid msi handle.
151 @param name
152 [in] the name of the module.
154 @returns
155 <TRUE/>if the specified module is about to be installed locally.
157 bool IsModuleSelectedForInstallation(MSIHANDLE handle, LPCTSTR name);
160 Determine if the specified module which is locally installed is
161 selected for deinstallation.
163 @param handle
164 [in] a valid msi handle.
166 @param name
167 [in] the name of the module.
169 @returns
170 <TRUE/>if the specified module is about to be deinstalled.
172 bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name);
175 Determine whether this is a complete uninstallation or not.
177 @param handle
178 [in] a valid msi handle.
180 @returns
181 <TRUE/>if this is a complete deinstallation.
183 bool IsCompleteDeinstallation(MSIHANDLE handle);
185 #endif
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */