예제 #1
0
        static void Main(string[] args)
        {
            // Make sure we can negotiate with HTTPS servers that demand TLS 1.2 (default in dotNet 4.6, but has to be turned on in 4.5)
            ServicePointManager.SecurityProtocol |= (SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12);

            if (Settings.Default.SettingsUpgradeRequired)
            {
                Settings.Default.Upgrade();
                Settings.Default.SettingsUpgradeRequired = false;
                Settings.Default.Save();
            }

            // The SkylineTester installation puts SkylineTester one directory too high.
            var nestedDirectory = Path.Combine(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "",
                SkylineTesterWindow.SkylineTesterFiles);
            var nestedSkylineTester = Path.Combine(nestedDirectory, "SkylineTester.exe");

            if (File.Exists(nestedSkylineTester))
            {
                var restartSkylineTester = new Process
                {
                    StartInfo =
                    {
                        FileName         = nestedSkylineTester,
                        Arguments        = args.Length > 0 ? args[0].Quote() : "",
                        WorkingDirectory = nestedDirectory
                    }
                };
                restartSkylineTester.Start();
                ExitWithStatusCodeForSkylineNightly();
            }

            if (args.Length == 1 && args[0].EndsWith(".zip"))
            {
                try
                {
                    AttachConsole(ATTACH_PARENT_PROCESS);
                    CreateZipInstallerWindow.CreateZipFile(args[0]);
                    Thread.Sleep(2000);
                }
                catch (Exception e)
                {
                    Console.WriteLine("FAILURE: Installer zip file \"{0}\" not created:", args[0]);
                    Console.WriteLine(e);
                    Environment.Exit(2);
                }
                ExitWithStatusCodeForSkylineNightly();
            }

            IsRunning = true;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new SkylineTesterWindow(args));
            ExitWithStatusCodeForSkylineNightly();
        }
예제 #2
0
        static void Main(string[] args)
        {
            // The SkylineTester installation puts SkylineTester one directory too high.
            var nestedDirectory = Path.Combine(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "",
                SkylineTesterWindow.SkylineTesterFiles);
            var nestedSkylineTester = Path.Combine(nestedDirectory, "SkylineTester.exe");

            if (File.Exists(nestedSkylineTester))
            {
                var restartSkylineTester = new Process
                {
                    StartInfo =
                    {
                        FileName         = nestedSkylineTester,
                        Arguments        = args.Length > 0 ? args[0].Quote() : "",
                        WorkingDirectory = nestedDirectory
                    }
                };
                restartSkylineTester.Start();
                ExitWithStatusCodeForSkylineNightly();
            }

            if (args.Length == 1 && args[0].EndsWith(".zip"))
            {
                try
                {
                    AttachConsole(ATTACH_PARENT_PROCESS);
                    CreateZipInstallerWindow.CreateZipFile(args[0]);
                    Thread.Sleep(2000);
                }
                catch (Exception e)
                {
                    Console.WriteLine("FAILURE: Installer zip file \"{0}\" not created:", args[0]);
                    Console.WriteLine(e);
                    Environment.Exit(2);
                }
                ExitWithStatusCodeForSkylineNightly();
            }

            IsRunning = true;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new SkylineTesterWindow(args));
            ExitWithStatusCodeForSkylineNightly();
        }
예제 #3
0
        static void Main(string[] args)
        {
            // The SkylineTester installation puts SkylineTester one directory too high.
            var nestedDirectory = Path.Combine(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "",
                SkylineTesterWindow.SkylineTesterFiles);
            var nestedSkylineTester = Path.Combine(nestedDirectory, "SkylineTester.exe");

            if (File.Exists(nestedSkylineTester))
            {
                var restartSkylineTester = new Process
                {
                    StartInfo =
                    {
                        FileName         = nestedSkylineTester,
                        Arguments        = args.Length > 0 ? args[0].Quote() : "",
                        WorkingDirectory = nestedDirectory
                    }
                };
                restartSkylineTester.Start();
                return;
            }

            if (args.Length == 1 && args[0].EndsWith(".zip"))
            {
                AllocConsole();
                CreateZipInstallerWindow.CreateZipFile(args[0]);
                Thread.Sleep(2000);
                return;
            }

            IsRunning = true;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new SkylineTesterWindow(args));
        }