--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Dotnet.Launcher
+{
+ class Environment
+ {
+ public static void SetEnvironmentVariable(string variable, string value)
+ {
+ System.Environment.SetEnvironmentVariable(variable, value);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.1</TargetFramework>
+ <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ <NoWin32Manifest>True</NoWin32Manifest>
+ <Configuration>Release</Configuration>
+ </PropertyGroup>
+
+</Project>
const char* entryPointMethodName,
void** delegate);
- typedef bool (*set_environment_variable_ptr)(const char16_t* name,
- const char16_t* value);
+ typedef bool (*set_environment_variable_ptr)(const char* name,
+ const char* value);
typedef int (*multi_byte_to_wide_char_ptr)(
unsigned int CodePage,
}
}
-static std::u16string utf8ToUtf16(char* str)
-{
- std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
- return convert.from_bytes(str);
-}
-
void CoreRuntime::preloadTypes()
{
const static std::string initDllPath = "/usr/share/dotnet.tizen/framework/Tizen.Init.dll";
CORELIB_RETURN_IF_NOSYM(coreclr_execute_assembly_ptr, executeAssembly, "coreclr_execute_assembly");
CORELIB_RETURN_IF_NOSYM(coreclr_shutdown_ptr, shutdown, "coreclr_shutdown");
CORELIB_RETURN_IF_NOSYM(coreclr_create_delegate_ptr, createDelegate, "coreclr_create_delegate");
- CORELIB_RETURN_IF_NOSYM(set_environment_variable_ptr, setEnvironmentVariable, "SetEnvironmentVariableW");
#undef CORELIB_RETURN_IF_NOSYM
return -1;
}
+ int st = createDelegate(__hostHandle, __domainId, "Dotnet.Launcher", "Dotnet.Launcher.Environment", "SetEnvironmentVariable", (void**)&setEnvironmentVariable);
+ if (st < 0 || setEnvironmentVariable == nullptr) {
+ _ERR("Create delegate for Dotnet.Launcher.dll -> Dotnet.Launcher.Environment -> SetEnvironmentVariable failed (0x%08x)", st);
+ return -1;
+ }
+
__initialized = true;
if (!standalone)
// application data path can be changed by owner. So, we have to set data path just before launching.
char* localDataPath = app_get_data_path();
if (localDataPath != nullptr) {
- std::u16string envval = utf8ToUtf16(localDataPath);
-
- if (!setEnvironmentVariable(u"XDG_DATA_HOME", envval.c_str())) {
- _ERR("Failed to set XDG_DATA_HOME");
- }
-
+ setEnvironmentVariable("XDG_DATA_HOME", localDataPath);
free(localDataPath);
}
dotnet msbuild Init/Tizen.Init.csproj /t:restore /p:RestoreSources=/nuget
dotnet msbuild Init/Tizen.Init.csproj
+dotnet msbuild Managed/Dotnet.Launcher.csproj /t:clean
+dotnet msbuild Managed/Dotnet.Launcher.csproj /t:restore /p:RestoreSources=/nuget
+dotnet msbuild Managed/Dotnet.Launcher.csproj
+
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if 0%{?asan_enabled}
%make_install
mkdir -p %{buildroot}%{_framework_dir}
mv Init/bin/Release/Tizen.Init.dll %{buildroot}%{_framework_dir}
+mv Managed/bin/Release/Dotnet.Launcher.dll %{buildroot}%{_framework_dir}
mkdir -p %{buildroot}%{_tac_dir}
/etc/tmpfiles.d/%{name}.conf
/usr/share/parser-plugins/dotnet-launcher.info
%{_framework_dir}/Tizen.Init.dll
+%{_framework_dir}/Dotnet.Launcher.dll
%{_tac_dir}
%files devel
%{_libdir}/libdotnet_launcher_util.so
%{_libdir}/libni_common.so
%{_libdir}/pkgconfig/dotnet-launcher.pc
-