예제 #1
0
 private void PrepInstaller()
 {
     DisableButtons();
     installer = new AppxInstaller(GetResourcePath(info.appxBundlePath), GetResourcePath(info.certPath), GetResourcePath(info.dependenciesPath));
     installer.ProgressChanged      += OnInstallProgressChanged;
     installer.StateChanged         += OnInstallStateChanged;
     installer.InstallationComplete += OnInstallComplete;
 }
예제 #2
0
 private async void OnInstallStateChanged(AppxInstaller sender, StateChangedEventArgs args)
 {
     if (args.STATE == AppxInstallerState.ERROR)
     {
         UpdateProgressInvoke(100, "Installation failed with a fatal error: " + (args.EXCEPTION is null ? "null" : args.EXCEPTION.Message));
         Dispatcher.Invoke(() => EnableButtons());
     }
     else if (args.STATE == AppxInstallerState.SUCCESS && Dispatcher.Invoke(() => startOnceDone_chbx.IsChecked) == true)
     {
         await LauchUwpxAsync();
     }
 }
예제 #3
0
        private void OnInstallComplete(AppxInstaller sender, InstallationCompleteEventArgs args)
        {
            string msg;

            if (args.RESULT is null)
            {
                msg = "Installation failed with a fatal error!";
            }
            else if (args.RESULT.IsRegistered)
            {
                msg = "Done";
            }
            else
            {
                msg = "Installation failed with: " + args.RESULT.ErrorText;
            }
            UpdateProgressInvoke(100, msg);
            Dispatcher.Invoke(() => EnableButtons());
        }
예제 #4
0
 private void OnInstallProgressChanged(AppxInstaller sender, ProgressChangedEventArgs args)
 {
     UpdateProgressInvoke(args.PROGRESS.percentage, args.PROGRESS.state.ToString());
 }