Пример #1
0
 public static void Run(AppAssemblyResolver resolver, string appName)
 {
     Log.Information("{Stage} - Applying patches", "Stage 2");
     NetRuntimePatches.Apply();
     ApplicationPatches.Apply();
     ChainloaderStage3.Run(resolver, appName);
 }
Пример #2
0
        public static void Run(string appName)
        {
            Log.Information("{Stage} - Setting up assembly resolve", "Stage 1");
            var resolver = AppAssemblyResolver.GetForApplication(appName);

            AppDomain.CurrentDomain.AssemblyResolve += resolver.HandleAssemblyResolve;
            ChainloaderStage2.Run(resolver, appName);
        }
Пример #3
0
        public static void Run(AppAssemblyResolver resolver, string appName)
        {
            Log.Information("{Stage} - Preparing runtime context", "Stage 3");
            var ctx = AppContext.Configure(resolver.Load(appName + ".exe"));

            ctx.AddPlugin(typeof(Plugins.AffinityExPlugin));
            ctx.LoadPluginDirectory(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
            ctx.LoadPluginDirectory(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"));
            ctx.LoadPluginDirectory(Path.Combine(ctx.InstallationDirectory, "Plugins"));
            ctx.LoadPluginDirectory(Path.Combine(ctx.InstallationDirectory, "..", "Common", "Plugins"));
            ctx.RunSingleInstance();
        }