public Packer(IPackerContext ctx) { Globals.Context = ctx; ctx.OutPath = ctx.OutPath ?? Path.Combine(Path.GetDirectoryName(ctx.InPath), "NETPack_Output", Path.GetFileName(ctx.InPath) + "_packed.exe"); ctx.LocalPath = Assembly.GetExecutingAssembly().Location.GetPath(); ctx.LogWriter = new StreamWriter(Path.Combine(ctx.LocalPath, "log.txt")); ctx.TargetAssembly = AssemblyDefinition.ReadAssembly(ctx.InPath); if (!ctx.VerifyContext()) { throw new Exception("Failed to verify context!"); } // Logger.FLog(Header + "\r\n\r\n"); Globals.Context.UIProvider.GlobalLog(ConsoleHeader + "\r\n\r\n"); Globals.Bugster = new BugReporter("5351ddb5009c5b025fd1a89409b3f262", new NETPackExceptionFormatter()); //AppDomain.CurrentDomain.UnhandledException += Globals.Bugster.UnhandledExceptionHandler; Globals.Bugster.ReportCompleted += (o, e) => { if (e.WasSuccesful) { Console.WriteLine( "An unhandled exception have occured and caused NETPack to terminate!\n\nAn automatic report have been sent to the author."); } else { Console.WriteLine("Contact author!"); } }; }
public Packer(IPackerContext ctx) { Globals.Context = ctx; ctx.OutPath = ctx.OutPath ?? Path.Combine(Path.GetDirectoryName(ctx.InPath), "NETPack_Output", Path.GetFileName(ctx.InPath) + "_packed.exe"); ctx.LocalPath = Assembly.GetExecutingAssembly().Location.GetPath(); ctx.LogWriter = new StreamWriter(Path.Combine(ctx.LocalPath, "log.txt")); ctx.TargetAssembly = AssemblyDefinition.ReadAssembly(ctx.InPath); if (!ctx.VerifyContext()) throw new Exception("Failed to verify context!"); // Logger.FLog(Header + "\r\n\r\n"); Globals.Context.UIProvider.GlobalLog(ConsoleHeader + "\r\n\r\n"); Globals.Bugster = new BugReporter("5351ddb5009c5b025fd1a89409b3f262", new NETPackExceptionFormatter()); //AppDomain.CurrentDomain.UnhandledException += Globals.Bugster.UnhandledExceptionHandler; Globals.Bugster.ReportCompleted += (o, e) => { if (e.WasSuccesful) { Console.WriteLine( "An unhandled exception have occured and caused NETPack to terminate!\n\nAn automatic report have been sent to the author."); } else Console.WriteLine("Contact author!"); }; }