コード例 #1
0
        public InstallerProgressEventArgs(InstallCompletedEventArgs evtArgs, int total, int amountInstalled)
        {
            if (evtArgs != null)
            {
                Name = evtArgs.Extension.Header.Name;
                Error = evtArgs.Error;
            }

            Total = total;
            AmountInstalled = amountInstalled;
        }
コード例 #2
0
ファイル: Main.xaml.cs プロジェクト: robertbaker/SevenUpdate
 /// <summary>Sets the UI when the installation of updates has completed.</summary>
 /// <param name="sender">The object that called the event.</param>
 /// <param name="e">The <c>SevenUpdate.InstallCompletedEventArgs</c> instance containing the event data.</param>
 void InstallCompleted(object sender, InstallCompletedEventArgs e)
 {
     if (!this.Dispatcher.CheckAccess())
     {
         this.Dispatcher.BeginInvoke(this.InstallCompleted, e);
     }
     else
     {
         this.InstallCompleted(e);
     }
 }
コード例 #3
0
        public InstallerProgressEventArgs(InstallCompletedEventArgs evtArgs, int total, int amountInstalled)
        {
            if (evtArgs != null)
            {
                Name  = evtArgs.Extension.Header.Name;
                Error = evtArgs.Error;
            }

            Total           = total;
            AmountInstalled = amountInstalled;
        }
コード例 #4
0
ファイル: App.cs プロジェクト: robertbaker/SevenUpdate
 /// <summary>Reports the installation has completed.</summary>
 /// <param name="sender">The object that called the event.</param>
 /// <param name="e">The <c>InstallCompletedEventArgs</c> instance containing the event data.</param>
 static void InstallCompleted(object sender, InstallCompletedEventArgs e)
 {
     IsInstalling = false;
     File.Delete(Path.Combine(AllUserStore, "updates.sui"));
     if (isClientConnected)
     {
         client.OnInstallCompleted(sender, e);
     }
     else
     {
         ShutdownApp();
     }
 }
コード例 #5
0
ファイル: Main.xaml.cs プロジェクト: robertbaker/SevenUpdate
        /// <summary>Updates the UI when the installation has completed.</summary>
        /// <param name="e">The InstallCompleted data.</param>
        void InstallCompleted(InstallCompletedEventArgs e)
        {
            Settings.Default.LastInstall = DateTime.Now;
            Core.Instance.IsAdmin        = false;

            // if a reboot is needed lets say it
            if (Utilities.RebootNeeded)
            {
                Core.Instance.UpdateAction = UpdateAction.RebootNeeded;
                return;
            }

            Core.Instance.UpdateAction = UpdateAction.InstallationCompleted;

            if (e.UpdatesFailed <= 0)
            {
                this.tbStatus.Text = e.UpdatesInstalled == 1
                                         ? Properties.Resources.UpdateInstalled
                                         : string.Format(
                    CultureInfo.CurrentCulture,
                    Properties.Resources.UpdatesInstalled,
                    e.UpdatesInstalled);
                return;
            }

            Core.Instance.UpdateAction = UpdateAction.ErrorOccurred;

            if (e.UpdatesInstalled == 0)
            {
                this.tbStatus.Text = e.UpdatesFailed == 1
                                         ? Properties.Resources.UpdateFailed
                                         : string.Format(
                    CultureInfo.CurrentCulture,
                    Properties.Resources.UpdatesFailed,
                    e.UpdatesFailed);
            }
            else
            {
                this.tbStatus.Text = string.Format(
                    CultureInfo.CurrentCulture,
                    Properties.Resources.UpdatesInstalledFailed,
                    e.UpdatesInstalled,
                    e.UpdatesFailed);
            }
        }
コード例 #6
0
ファイル: App.cs プロジェクト: robertbaker/SevenUpdate
 /// <summary>Reports the installation has completed.</summary>
 /// <param name="sender">The object that called the event.</param>
 /// <param name="e">The <c>InstallCompletedEventArgs</c> instance containing the event data.</param>
 static void InstallCompleted(object sender, InstallCompletedEventArgs e)
 {
     IsInstalling = false;
     File.Delete(Path.Combine(AllUserStore, "updates.sui"));
     if (isClientConnected)
     {
         client.OnInstallCompleted(sender, e);
     }
     else
     {
         ShutdownApp();
     }
 }
コード例 #7
0
ファイル: Main.xaml.cs プロジェクト: robertbaker/SevenUpdate
 /// <summary>Sets the UI when the installation of updates has completed.</summary>
 /// <param name="sender">The object that called the event.</param>
 /// <param name="e">The <c>SevenUpdate.InstallCompletedEventArgs</c> instance containing the event data.</param>
 void InstallCompleted(object sender, InstallCompletedEventArgs e)
 {
     if (!this.Dispatcher.CheckAccess())
     {
         this.Dispatcher.BeginInvoke(this.InstallCompleted, e);
     }
     else
     {
         this.InstallCompleted(e);
     }
 }
コード例 #8
0
ファイル: Main.xaml.cs プロジェクト: robertbaker/SevenUpdate
        /// <summary>Updates the UI when the installation has completed.</summary>
        /// <param name="e">The InstallCompleted data.</param>
        void InstallCompleted(InstallCompletedEventArgs e)
        {
            Settings.Default.LastInstall = DateTime.Now;
            Core.Instance.IsAdmin = false;

            // if a reboot is needed lets say it
            if (Utilities.RebootNeeded)
            {
                Core.Instance.UpdateAction = UpdateAction.RebootNeeded;
                return;
            }

            Core.Instance.UpdateAction = UpdateAction.InstallationCompleted;

            if (e.UpdatesFailed <= 0)
            {
                this.tbStatus.Text = e.UpdatesInstalled == 1
                                         ? Properties.Resources.UpdateInstalled
                                         : string.Format(
                                             CultureInfo.CurrentCulture,
                                             Properties.Resources.UpdatesInstalled,
                                             e.UpdatesInstalled);
                return;
            }

            Core.Instance.UpdateAction = UpdateAction.ErrorOccurred;

            if (e.UpdatesInstalled == 0)
            {
                this.tbStatus.Text = e.UpdatesFailed == 1
                                         ? Properties.Resources.UpdateFailed
                                         : string.Format(
                                             CultureInfo.CurrentCulture,
                                             Properties.Resources.UpdatesFailed,
                                             e.UpdatesFailed);
            }
            else
            {
                this.tbStatus.Text = string.Format(
                    CultureInfo.CurrentCulture,
                    Properties.Resources.UpdatesInstalledFailed,
                    e.UpdatesInstalled,
                    e.UpdatesFailed);
            }
        }
コード例 #9
0
 /// <summary>Occurs when the installation of updates has completed.</summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">The event data.</param>
 public void OnInstallCompleted(object sender, InstallCompletedEventArgs e)
 {
     this.Channel.OnInstallCompleted(sender, e);
 }