Add installer plugin and tool for create a NI
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / dotnet / dotnet_launcher.h
1 #include "launcher.h"
2
3 extern "C"
4 {
5   typedef int (*coreclr_initialize_ptr)(
6       const char* exePath,
7       const char* appDomainFriendlyName,
8       int propertyCount,
9       const char** propertyKeys,
10       const char** propertyValues,
11       void** hostHandle,
12       unsigned int* domainId);
13
14   typedef int (*coreclr_execute_assembly_ptr)(
15       void* hostHandle,
16       unsigned int domainId,
17       int argc,
18       const char** argv,
19       const char* managedAssemblyPath,
20       unsigned int* exitCode);
21
22   typedef int (*coreclr_shutdown_ptr)(
23       void* hostHandle,
24       unsigned int domainId);
25
26   typedef int (*coreclr_create_delegate_ptr)(
27       void* hostHandle,
28       unsigned int domainId,
29       const char* entryPointAssemblyName,
30       const char* entryPointTypeName,
31       const char* entryPointMethodName,
32       void** delegate);
33 }
34
35 namespace tizen {
36 namespace runtime {
37 namespace dotnetcore {
38
39 typedef void (*PreparedFunctionPtr)();
40 typedef bool (*LaunchFunctionPtr)(const char* root, const char* path, int argc, char* argv[]);
41
42 class CoreRuntime : public tizen::runtime::LauncherInterface
43 {
44   public:
45     CoreRuntime();
46     ~CoreRuntime();
47     int Initialize(bool standalone) override;
48     void Dispose() override;
49     int RunManagedLauncher() override;
50     int Launch(const char* root, const char* path, int argc, char* argv[]) override;
51
52   private:
53     bool InitializeCoreClr(const char* assembly_probe_paths, const char* pinvoke_probe_paths);
54     coreclr_initialize_ptr InitializeClr;
55     coreclr_execute_assembly_ptr ExecuteAssembly;
56     coreclr_shutdown_ptr Shutdown;
57     coreclr_create_delegate_ptr CreateDelegate;
58     std::string DeviceAPIDirectory;
59     std::string RuntimeDirectory;
60     std::string LauncherAssembly;
61     void* coreclrLib;
62     void* hostHandle;
63     unsigned int domainId;
64     PreparedFunctionPtr PreparedFunction;
65     LaunchFunctionPtr LaunchFunction;
66 };
67
68 }  // dotnetcore
69 }  // namespace runtime
70 }  // namespace tizen