/********* ** Public methods *********/ /// <summary>Run the install or uninstall script.</summary> /// <param name="args">The command line arguments.</param> public static void Main(string[] args) { // find install bundle FileInfo zipFile = new FileInfo(Path.Combine(Program.InstallerPath, "install.dat")); if (!zipFile.Exists) { Console.WriteLine($"Oops! Some of the installer files are missing; try re-downloading the installer. (Missing file: {zipFile.FullName})"); Console.ReadLine(); return; } // unzip bundle into temp folder DirectoryInfo bundleDir = new DirectoryInfo(Program.ExtractedBundlePath); Console.WriteLine("Extracting install files..."); ZipFile.ExtractToDirectory(zipFile.FullName, bundleDir.FullName); // set up assembly resolution AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; // launch installer var installer = new InteractiveInstaller(bundleDir.FullName); try { installer.Run(args); } catch (Exception ex) { Program.PrintErrorAndExit($"The installer failed with an unexpected exception.\nIf you need help fixing this error, see https://smapi.io/help\n\n{ex}"); } }
/********* ** Public methods *********/ /// <summary>Run the install or uninstall script.</summary> /// <param name="args">The command line arguments.</param> public static void Main(string[] args) { // find install bundle PlatformID platform = Environment.OSVersion.Platform; FileInfo zipFile = new FileInfo(Path.Combine(Program.InstallerPath, $"{(platform == PlatformID.Win32NT ? "windows" : "unix")}-install.dat")); if (!zipFile.Exists) { Console.WriteLine($"Oops! Some of the installer files are missing; try re-downloading the installer. (Missing file: {zipFile.FullName})"); Console.ReadLine(); return; } // unzip bundle into temp folder DirectoryInfo bundleDir = new DirectoryInfo(Program.ExtractedBundlePath); Console.WriteLine("Extracting install files..."); ZipFile.ExtractToDirectory(zipFile.FullName, bundleDir.FullName); // set up assembly resolution AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; // launch installer var installer = new InteractiveInstaller(bundleDir.FullName); installer.Run(args); }
/********* ** Public methods *********/ /// <summary>Run the install or uninstall script.</summary> /// <param name="args">The command line arguments.</param> public static void Main(string[] args) { // set up assembly resolution AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; // launch installer var installer = new InteractiveInstaller(); installer.Run(args); }
/********* ** Public methods *********/ /// <summary>Run the install or uninstall script.</summary> /// <param name="args">The command line arguments.</param> public static void Main(string[] args) { // set up assembly resolution string installerPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Program.DllSearchPath = EnvironmentUtility.DetectPlatform() == Platform.Windows ? Path.Combine(installerPath, "internal", "Windows", "smapi-internal") : Path.Combine(installerPath, "smapi-internal"); AppDomain.CurrentDomain.AssemblyResolve += Program.CurrentDomain_AssemblyResolve; // launch installer var installer = new InteractiveInstaller(); installer.Run(args); }