Beispiel #1
0
        private string GetInstallationDirectory(UpdateStartupContext startupContext)
        {
            Logger.Debug("Using process ID to find installation directory: {0}", startupContext.ProcessId);
            var exeFileInfo = new FileInfo(_processProvider.GetProcessById(startupContext.ProcessId).StartPath);

            Logger.Debug("Executable location: {0}", exeFileInfo.FullName);

            return(exeFileInfo.DirectoryName);
        }
Beispiel #2
0
        public void Start(string[] args)
        {
            int processId = ParseProcessId(args);

            var    exeFileInfo  = new FileInfo(_processProvider.GetProcessById(processId).StartPath);
            string targetFolder = exeFileInfo.Directory.FullName;

            logger.Info("Starting update process. Target Path:{0}", targetFolder);
            _installUpdateService.Start(targetFolder);
        }
 protected override void DetachProfilingInternal()
 {
     if (ProcessId != 0)
     {
         IProcess process = _processProvider.GetProcessById(ProcessId);
         if (!process.HasExited)
         {
             process.Kill();
             process.Dispose();
         }
     }
 }
Beispiel #4
0
        private string GetInstallationDirectory(UpdateStartupContext startupContext)
        {
            if (startupContext.ExecutingApplication.IsNullOrWhiteSpace())
            {
                logger.Debug("Using process ID to find installation directory: {0}", startupContext.ProcessId);
                var exeFileInfo = new FileInfo(_processProvider.GetProcessById(startupContext.ProcessId).StartPath);
                logger.Debug("Executable location: {0}", exeFileInfo.FullName);

                return(exeFileInfo.DirectoryName);
            }

            else
            {
                logger.Debug("Using executing application: {0}", startupContext.ExecutingApplication);
                var exeFileInfo = new FileInfo(startupContext.ExecutingApplication);
                logger.Debug("Executable location: {0}", exeFileInfo.FullName);

                return(exeFileInfo.DirectoryName);
            }
        }
Beispiel #5
0
        public void Start(string[] args)
        {
            var    startupContext = ParseArgs(args);
            string targetFolder;

            if (startupContext.ExecutingApplication.IsNullOrWhiteSpace())
            {
                var exeFileInfo = new FileInfo(_processProvider.GetProcessById(startupContext.ProcessId).StartPath);
                targetFolder = exeFileInfo.Directory.FullName;
            }

            else
            {
                var exeFileInfo = new FileInfo(startupContext.ExecutingApplication);
                targetFolder = exeFileInfo.Directory.FullName;
            }

            logger.Info("Starting update process. Target Path:{0}", targetFolder);
            _installUpdateService.Start(targetFolder, startupContext.ProcessId);
        }