Example #1
0
 public SetupWorker(SetupData Data)
 {
     this.Data = Data;
 }
Example #2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (HasConsole)
            {
                Console.WriteLine("\r\n\r\n{0} Starting...", Title);
            }

            packer = new Packer();

            string prepare = GetArg("-prepare");

            if (prepare != null)
            {
                bool ret = packer.PrepareSetup(prepare);
                Environment.Exit(ret ? 0 : -1);
            }

            string target = GetArg("-extract");

            if (target != null)
            {
                bool ret = packer.Extract(target);
                Environment.Exit(ret ? 0 : -1);
            }


            if (packer.IsValid())
            {
                bool ret = packer.Test();
                if (!ret)
                {
                    ShowMessage("{0} file is corrupted! Please download a working copy.", App.Title);
                    Environment.Exit(-1);
                }
            }

            /*else if(!App.TestArg("-uninstall"))
             * {
             *  ShowMessage("Setup is empty, please run PrivateSetup.exe -prepare");
             *  Environment.Exit(-1);
             * }*/

#if DEBUG
            if (TestArg("-test"))
            {
                bool ret = packer.Test();
                Environment.Exit(ret ? 0 : -1);
            }

            if (TestArg("-enum"))
            {
                packer.Enum();
                Environment.Exit(0);
            }
#endif

            /*if (TestArg("-empty"))
             * {
             *  installer.Empty();
             *  Environment.Exit(0);
             * }*/


            SetupData Data        = SetupData.FromArgs();
            bool      Uninstaller = App.TestArg("-uninstall") || !packer.IsValid(false);

            SetupWindow wnd = new SetupWindow(Data, Uninstaller);
            wnd.Show();
        }