summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
blob: a07dfbaa9f92d576c1d07b53cd714a0f71db6496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#ifndef INCLUDED_MSIHELPER_HXX
#define INCLUDED_MSIHELPER_HXX

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include <msiquery.h>
#include <string>

/**
    Get the value of the named property

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the property.

    @param value
    [out] receives thes value of the property.

    @returns
    <TRUE/>if the property was found.
*/
bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value);

/**
    Set the value of a binary property which can only
    have the values "0" or "1" to "1".

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the property.
*/
void SetMsiProp(MSIHANDLE handle, LPCTSTR name);

/**
    Set the value of a binary property which can only
    have the values "0" or "1" to "0".

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the property.
*/
void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);

/**
    Returns whether a certain property is set meaning
    its value is "1". This method should be used for
    binary properties whose value can be "0" or "1".

    @returns
    <TRUE/>if the value of the specified property is
    "1" else if the property is not defined or its
    value is other than "1" <FALSE/> will be returned.
*/
bool IsSetMsiProp(MSIHANDLE handle, LPCTSTR name);

/**
    Query if this is an installation for all user or not.

    @param handle
    [in] a valid msi handle.

    @returns
    <TRUE/>if this is an all user installation
*/
bool IsAllUserInstallation(MSIHANDLE handle);

/**
    Returns the destination folder of the office installation
    as system path. The returned path contains a final '\'.

    @param handle
    [in] a valid msi handle.

    @returns
    the destination path of the office installation finalized
    with a '\'.
*/
std::wstring GetOfficeInstallationPath(MSIHANDLE handle);

/**
    Returns the absolute path of the office executable that
    will be installed as system path.

    @param handle
    [in] a valid msi handle.

    @returns
    the absolute system path of the office executable (e.g.
    (C:\Program Files\StarOffice 8\program\soffice.exe").
*/
std::wstring GetOfficeExecutablePath(MSIHANDLE handle);

/**
    Get the name of the office that will be installed
    (e.g. StarOffice 8, StarSuite 8, ...).

    @param handle
    [in] a valid msi handle.

    @returns
    the name of the office product that will be installed.
*/
std::wstring GetProductName(MSIHANDLE handle);

/**
    Determine if the specified module is installed locally.

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the module.

    @returns
    <TRUE/>if the specified module is installed locally.
*/
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);

/**
    Determine if the specified module is selected to be installed
    locally.

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the module.

    @returns
    <TRUE/>if the specified module is about to be installed locally.
*/
bool IsModuleSelectedForInstallation(MSIHANDLE handle, LPCTSTR name);

/**
    Determine if the specified module which is locally installed is
    selected for deinstallation.

    @param handle
    [in] a valid msi handle.

    @param name
    [in] the name of the module.

    @returns
    <TRUE/>if the specified module is about to be deinstalled.
*/
bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name);

/**
    Determine whether this is a complete uninstallation or not.

    @param handle
    [in] a valid msi handle.

    @returns
    <TRUE/>if this is a complete deinstallation.
*/
bool IsCompleteDeinstallation(MSIHANDLE handle);

#endif