MsiInstall.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc {
4 namespace Msi {
5 
7 class MsiInstall
8 {
9 private:
10  MSIHANDLE _h;
11  MsiInstall& msiInstall; // CHECK_* macros need something called msiInstall to log errors
12 public:
13  MSIHANDLE Peek() const { return _h; }
15  std::wstring GetProperty(const std::wstring& name);
17  void SetProperty(const std::wstring& name, const std::wstring& value);
19  std::string GetProperty(const std::string& name);
21  void SetProperty(const std::string& name, const std::string& value);
23  void GetBinaryData(const std::wstring& name, std::vector<char>& data);
25  std::wstring GetViewData(const std::wstring& query);
27  void GetViewInfo(const std::wstring& query, std::vector<std::wstring>& names, std::vector<std::wstring>& types);
29  void SetActionData(const std::wstring& action, const std::wstring& data);
31  std::wstring GetActionData();
33  void LogError(int error);
35  void LogError(const std::wstring& message);
37  void LogInfo(const std::wstring& action, const std::wstring& message);
39  std::wstring GetFormattedString(const std::wstring& s);
41  bool EvaluateCondition(const std::wstring& condition);
43  bool IsInstalling();
45  bool IsReInstalling();
47  bool IsUnInstalling();
49  bool IsRollback();
51  bool IsComponentInstalling(const std::wstring& component);
53  bool IsComponentUnInstalling(const std::wstring& component);
55  bool IsComponentReInstalling(const std::wstring& component);
57  void GetComponentState(const std::wstring& component, INSTALLSTATE& component_installed, INSTALLSTATE& component_action);
59  void DoAction(const std::wstring& action);
60  MsiInstall(MSIHANDLE h);
61  virtual ~MsiInstall();
62 };
63 
64 }}
65 
bool IsComponentInstalling(const std::wstring &component)
returns true if the component is being installed
Definition: MsiInstall.cpp:360
bool EvaluateCondition(const std::wstring &condition)
evaluate a condition
Definition: MsiInstall.cpp:350
MsiInstall(MSIHANDLE h)
Definition: MsiInstall.cpp:3
void GetComponentState(const std::wstring &component, INSTALLSTATE &component_installed, INSTALLSTATE &component_action)
returns the component state
Definition: MsiInstall.cpp:426
bool IsComponentUnInstalling(const std::wstring &component)
returns true if the component is being uninstalled
Definition: MsiInstall.cpp:373
void SetProperty(const std::wstring &name, const std::wstring &value)
set a property
Definition: MsiInstall.cpp:61
void GetBinaryData(const std::wstring &name, std::vector< char > &data)
get binary data from the Binary table
Definition: MsiInstall.cpp:106
void DoAction(const std::wstring &action)
execute a custom action
Definition: MsiInstall.cpp:420
MSIHANDLE Peek() const
Definition: MsiInstall.h:13
bool IsRollback()
returns true if the current state is rollback
Definition: MsiInstall.cpp:404
bool IsInstalling()
returns true if the product is being installed
Definition: MsiInstall.cpp:398
A wrapper for an MSIHANDLE with MSI support functions.
Definition: MsiInstall.h:7
bool IsUnInstalling()
returns true if the product is being uninstalled
Definition: MsiInstall.cpp:414
void LogInfo(const std::wstring &action, const std::wstring &message)
log info
Definition: MsiInstall.cpp:67
void SetActionData(const std::wstring &action, const std::wstring &data)
set action data for a deferred custom action
Definition: MsiInstall.cpp:309
std::wstring GetActionData()
get action data from the CustomActionData property
Definition: MsiInstall.cpp:314
std::wstring GetViewData(const std::wstring &query)
get view data in xml format, executes the query and returns the result in a CustomTable format ...
Definition: MsiInstall.cpp:204
bool IsReInstalling()
returns true if the product is being reinstalled
Definition: MsiInstall.cpp:409
bool IsComponentReInstalling(const std::wstring &component)
returns true if the component is being reinstalled
Definition: MsiInstall.cpp:385
std::wstring GetProperty(const std::wstring &name)
get a property
Definition: MsiInstall.cpp:26
virtual ~MsiInstall()
Definition: MsiInstall.cpp:10
std::wstring GetFormattedString(const std::wstring &s)
get a formatted string
Definition: MsiInstall.cpp:319
void GetViewInfo(const std::wstring &query, std::vector< std::wstring > &names, std::vector< std::wstring > &types)
get information on a view (column names and types)
Definition: MsiInstall.cpp:147
void LogError(int error)
log an error defined in the Error table
Definition: MsiInstall.cpp:80


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com