Exemple #1
0
        /// <summary>
        ///     Compile the installer.
        /// </summary>
        /// <param name="installOptions">The install options.</param>
        private void CompileInstaller(InstallOptions installOptions)
        {
            // Ask to close and restart to update files with installer
            var _references = new List <string>
            {
                "System.dll",
                "System.Windows.Forms.dll"
            };

            ResourcesManager.CreateSettingsResource(installOptions.ResourceSettingsPath, installOptions);

            var _resources = new List <string>
            {
                installOptions.ResourceSettingsPath
            };

            var _sources = new[] { Resources.MainEntryPoint, Resources.ConsoleManager, Resources.Installer, Resources.ResourceSettings };

            string _updaterFileName = Application.StartupPath + @"\\Updater.exe";

            CompilerResults _results = CodeDomCompiler.Build(_references, _sources, _updaterFileName, _resources);

            if (_results.Errors.Count > 0)
            {
                VisualCompileErrorDialog.Show(_results);
            }
            else
            {
                Process.Start(_updaterFileName);
            }

            File.Delete(installOptions.ResourceSettingsPath);
        }
Exemple #2
0
        /// <summary>Show the exception dialog.</summary>
        /// <param name="compilerResults">The compiler results.</param>
        /// <param name="caption">The caption.</param>
        /// <param name="dialogWindow">The dialog Window.</param>
        public static void Show(CompilerResults compilerResults, string caption = "Compile Error Dialog", bool dialogWindow = true)
        {
            VisualCompileErrorDialog compileErrorDialog = new VisualCompileErrorDialog(compilerResults)
            {
                Text          = caption,
                StartPosition = FormStartPosition.CenterScreen
            };

            if (dialogWindow)
            {
                compileErrorDialog.ShowDialog();
            }
            else
            {
                compileErrorDialog.Show();
            }
        }