Example #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            if (args.Length > 0)
            {
                // Parse the command line args
                var install = ParseCommandLine(args);
                if (install == true)
                {
                    InstallationManager.Install(args);
                }
                else if (install == false)
                {
                    InstallationManager.Uninstall(args);
                }
                else
                {
                    Trace.Listeners.Add(new ConsoleTraceListener());
                    Trace.WriteLine("Debugging press return to exit...");
                    var svc = new SyslogSharpService();
                    svc.Debug();
                    Console.ReadLine();
                    Trace.WriteLine("Finished.");

//					Console.WriteLine("Invalid command line args -i for install or -u for uninstall");
                }
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SyslogSharpService() };

                ServiceBase.Run(servicesToRun);
            }
        }
Example #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            if (args.Length > 0)
            {
                // Parse the command line args
                var install = ParseCommandLine(args);
                if (install == true)
                {
                    InstallationManager.Install(args);
                }
                else if (install == false)
                {
                    InstallationManager.Uninstall(args);
                }
                else
                {
                    Console.WriteLine("Invalid command line args -i for install or -u for uninstall");
                }
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SyslogSharpService() };
                ServiceBase.Run(servicesToRun);
            }
        }
        public void Install_ResetsInstallationStatusCache()
        {
            // arrange
            var cache = new TestCache();

            cache["NeedsInstallation"] = InstallationState.NeedsInstallation;
            var installer = new Mock <IInstaller>();

            installer.Setup(i => i.Install(It.IsAny <Version>()));
            var installManager = new InstallationManager(installer.Object, cache);

            // act
            installManager.Install(new Version());

            // assert
            Assert.IsNull(cache["NeedsInstallation"]);
        }
Example #4
0
        private void InstallIfNeeded(IVsShell shellService)
        {
            if (shellService == null)
            {
                ShellDialogs.Error(this, Resources.ErrorMessage_ShellServiceUnavailable);
                return;
            }

            ThreadHelper.ThrowIfNotOnUIThread();
            shellService.GetProperty((int)__VSSPROPID2.VSSPROPID_VisualStudioDir, out object documentsDirObj);
            string           documentsDir     = documentsDirObj.ToString();
            string           targetPath       = Path.Combine(documentsDir, "Visualizers");
            InstallationInfo installedVersion = InstallationManager.GetInstallationInfo(targetPath);
            InstallationInfo availableVersion = InstallationManager.AvailableVersion;

            if (installedVersion.Installed && (installedVersion.Version == null || installedVersion.Version >= availableVersion.Version))
            {
                return;
            }

            InstallationManager.Install(targetPath, out string error, out string warning);
            if (error != null)
            {
                ShellDialogs.Error(this, Res.ErrorMessageFailedToInstall(targetPath, error));
            }
            else if (warning != null)
            {
                ShellDialogs.Warning(this, Res.WarningMessageInstallationFinishedWithWarning(targetPath, warning));
            }
            else if (installedVersion.Installed && installedVersion.Version != null)
            {
                ShellDialogs.Info(this, Res.InfoMessageUpgradeFinished(installedVersion.Version, availableVersion.Version, targetPath));
            }
            else
            {
                ShellDialogs.Info(this, Res.InfoMessageInstallationFinished(availableVersion.Version, targetPath));
            }
        }
 protected virtual void OnInstallClick(object sender, EventArgs e)
 {
     InstallationManager.Install(VersionInfo.CurrentAssemblyVersion);
     Response.Redirect(NextStepUrl);
 }
Example #6
0
        /// <summary>
        /// Executes the installation of the Programm
        /// </summary>
        static void Install()
        {
            InstallationManager helper = new InstallationManager(_logManager.GetLogger(LoggerType.Installer));

            helper.Install();
        }