return 1;
}
+ std::string cpppath(path);
+
+ if (IsManagedAssembly(cpppath) && !IsNativeImage(cpppath))
+ {
+ size_t extindex = cpppath.size() - 4;
+ cpppath = cpppath.substr(0, extindex) + ".ni" + cpppath.substr(extindex, 4);
+ if (!FileNotExist(cpppath))
+ {
+ path = cpppath.c_str();
+ }
+ }
+
if (FileNotExist(path))
{
_ERR("File not exist : %s", path);
static std::string VersionOption("--version");
static std::string StandaloneOption("--standalone");
+static std::string NativeOption("--native");
int main(int argc, char *argv[])
{
int i;
bool standalone = false;
const char* standalonePath = nullptr;
+ bool nativeOnly = false;
std::vector<char*> vargs;
i++;
standalonePath = argv[i];
}
+ else if (NativeOption.compare(argv[i]) == 0)
+ {
+ nativeOnly = true;
+ }
else
{
vargs.push_back(argv[i]);
}
}
+ if (!standalone && nativeOnly)
+ {
+ fprintf(stderr, "\"--native\" option must be use with \"--standalone\"\n");
+ return 1;
+ }
+
using tizen::runtime::LauncherInterface;
using tizen::runtime::Launchpad;
using tizen::runtime::AppInfo;
return 1;
}
+ if (!nativeOnly && runtime->RunManagedLauncher() != 0)
+ {
+ _ERR("Failed to run managed launcher");
+ return 1;
+ }
+
int args_len = vargs.size();
char** args = &vargs[0];
if (runtime->Launch(approot.c_str(), standalonePath, args_len, args))
FileInfo f = new FileInfo(dllPath);
if (File.Exists(f.FullName))
{
- Assembly asm = CurrentAssemblyLoaderContext.LoadFromAssemblyPath(f.FullName);
+ Assembly asm = null;
+ if (0 == string.Compare(f.FullName, f.FullName.Length - 7, ".ni", 0, 3, StringComparison.OrdinalIgnoreCase))
+ {
+ asm = CurrentAssemblyLoaderContext.LoadFromNativeImagePath(f.FullName, null);
+ }
+ else
+ {
+ asm = CurrentAssemblyLoaderContext.LoadFromAssemblyPath(f.FullName);
+ }
+
if (asm == null) throw new FileNotFoundException($"{f.FullName} is not found");
if (asm.EntryPoint == null) throw new ArgumentException($"{f.FullName} did not have EntryPoint");
asm.EntryPoint.Invoke(null, new object[]{argv});