Esempio n. 1
0
        /// <summary>
        /// The get update runner process info.
        /// </summary>
        /// <param name="parameters">
        /// The parameters.
        /// </param>
        /// <returns>
        /// The <see cref="ProcessStartInfo"/>.
        /// </returns>
        public static ProcessStartInfo GetUpdateRunnerProcessInfo(UpdateParameter parameters)
        {
            var runnerPath = Path.Combine(parameters.BackupPath, _runnerAsmName);
            var cmdLine = parameters.ToCommandLine();
            var startInfo = new ProcessStartInfo(runnerPath, typeof(LiveUpdateService) + " " + cmdLine) { UseShellExecute = false };

            // Signal that we want to use LiveUpdateService
            return startInfo;
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LiveUpdateRunner"/> class.
 /// </summary>
 /// <param name="parameters">
 /// The parameters.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public LiveUpdateRunner(UpdateParameter parameters, ILogger logger)
 {
     this._param = parameters;
     this._logger = logger;
 }
Esempio n. 3
0
        /// <summary>Check for latest update</summary>
        /// <returns>The upgradable version. Returns null if there is no newer version</returns>
        public UpdateRequest CheckForUpdate()
        {
            var newRequest = this._versionRetriever.CheckForUpdate();
            if (newRequest != null)
            {
                var curProcess = ProcessUtils.CurrentProcessLocation;

                var param = new UpdateParameter
                                {
                                    BackupPath = Path.Combine(this.GetBackupRoot(), newRequest.FromVersion.VersionNumber.ToString()),
                                    PackageLocation = AppUtil.GetLocalDataPath(this.GetType().Name + "\\Packages\\" + Guid.NewGuid()),
                                    ProcessToEnd = curProcess,
                                    RestartProcess = curProcess,
                                    NotifyMsg = true,
                                    TargetUpdatePath = this._baseAppPath
                                };
                newRequest.Parameters = param;
            }

            return newRequest;
        }