Ejemplo n.º 1
0
        private void Catalog_PackageInstalling(PackageCatalog sender, PackageInstallingEventArgs args)
        {
            var ignored = CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () =>
            {
                String eventDetails =
                    args.Package.Id.FullName + ","
                    + args.IsComplete + ","
                    + args.Progress + ","
                    + args.ErrorCode + ";"
                    + Environment.NewLine;
                Debug.WriteLine(eventDetails);

                var frame            = (Frame)Window.Current.Content;
                Type currentPageType = frame.SourcePageType;
                if (currentPageType.Equals(typeof(MainPage)))
                {
                    var page = (MainPage)frame.Content;

                    if (Package.Current.Id.FullName.Equals(args.Package.Id.FullName))
                    {
                        localSettings.Values["OverallProgress"] = args.Progress;
                        page.Set_Overall_ProgressBar_Value(args.Progress);
                    }
                }
                else
                {
                    if (Package.Current.Id.FullName.Equals(args.Package.Id.FullName))
                    {
                        localSettings.Values["OverallProgress"] = args.Progress;
                    }
                }
            });
        }
Ejemplo n.º 2
0
        public void OnPackageInstalling(PackageCatalog p, PackageInstallingEventArgs args)
        {
            if (args.IsComplete)
            {
                try
                {
                    var packageWrapper = PackageWrapper.GetWrapperFromPackage(args.Package);
                    if (!string.IsNullOrEmpty(packageWrapper.InstalledLocation))
                    {
                        var uwp = new UWP(packageWrapper);
                        uwp.InitializeAppInfo(packageWrapper.InstalledLocation);
                        foreach (var app in uwp.Apps)
                        {
                            Add(app);
                        }
                    }
                }

                // InitializeAppInfo will throw if there is no AppxManifest.xml for the package.
                // Note there are sometimes multiple packages per product and this doesn't necessarily mean that we haven't found the app.
                // eg. "Could not find file 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminalPreview_2020.616.45.0_neutral_~_8wekyb3d8bbwe\\AppxManifest.xml'."
                catch (System.IO.FileNotFoundException e)
                {
                    ProgramLogger.Exception(e.Message, e, GetType(), args.Package.InstalledLocation.ToString());
                }
            }
        }
Ejemplo n.º 3
0
 async void OnPackageInstalling(
     PackageCatalog sender,
     PackageInstallingEventArgs args)
 {
     if (args.IsComplete)
     {
         await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                        async() =>
         {
             await this.AddPictureSourceAsync(args.Package.Id.FullName,
                                              args.Package.Id.FullName);
         }
                                        );
     }
 }
Ejemplo n.º 4
0
        private void Catalog_PackageInstalling(PackageCatalog sender, PackageInstallingEventArgs args)
        {
            var ignored = CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () =>
            {
                if (Package.Current.Id.FullName.Equals(args.Package.Id.FullName))
                {
                    this.Overall_ProgressBar.Value = args.Progress;
                }

                String eventDetails =
                    args.Package.Id.FullName + ","
                    + args.IsComplete + ","
                    + args.Progress + ","
                    + args.ErrorCode + ";"
                    + Environment.NewLine;
                this.PackageStagingInstallingEvents_textBox.Text = eventDetails;
            });
        }
Ejemplo n.º 5
0
 private async void Catalog_PackageInstalling(PackageCatalog sender, PackageInstallingEventArgs args)
 {
     if (args.Progress == 100 && args.IsComplete && args.Package.IsOptional && args.Package.Id.FamilyName.Contains("Approvals"))
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             OpTitle.Visibility     = Visibility.Visible;
             ToApprovals.Visibility = Visibility.Visible;
         });
     }
     else if ((args.Progress == 100 && args.IsComplete && args.Package.IsOptional && args.Package.Id.FamilyName.Contains("Employees")))
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             OpTitle.Visibility     = Visibility.Visible;
             ToEmployees.Visibility = Visibility.Visible;
         });
     }
 }
Ejemplo n.º 6
0
 private async void Catalog_PackageInstalling(PackageCatalog sender, PackageInstallingEventArgs args)
 {
     if (args.Progress == 100 && args.IsComplete &&
         args.Package.IsOptional && args.Package.Id.FamilyName.Contains("FabrikamFaceFilters"))
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                       () =>
         {
             FilterStackPanel.Visibility = Visibility.Visible;
         });
     }
     else if ((args.Progress == 100 && args.IsComplete &&
               args.Package.IsOptional && args.Package.Id.FamilyName.Contains("FabrikamAgeAnalysis")))
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                       () =>
         {
             UtilityStackPanel.Visibility = Visibility.Visible;
         });
     }
 }
Ejemplo n.º 7
0
        public void OnPackageInstalling(PackageCatalog p, PackageInstallingEventArgs args)
        {
            if (args.IsComplete)
            {
                try
                {
                    var uwp = new UWP(args.Package);
                    uwp.InitializeAppInfo(args.Package.InstalledLocation.Path);
                    foreach (var app in uwp.Apps)
                    {
                        Add(app);
                    }
                }
                //InitializeAppInfo will throw if there is no AppxManifest.xml for the package.
                //Note there are sometimes multiple packages per product and this doesn't necessarily mean that we haven't found the app.
                //eg. "Could not find file 'C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminalPreview_2020.616.45.0_neutral_~_8wekyb3d8bbwe\\AppxManifest.xml'."

                catch (System.IO.FileNotFoundException e)
                {
                    ProgramLogger.LogException($"|UWP|OnPackageInstalling|{args.Package.InstalledLocation}|{e.Message}", e);
                }
            }
        }
Ejemplo n.º 8
0
        private void Catalog_PackageInstalling(PackageCatalog sender, PackageInstallingEventArgs args)
        {
            if (args.Progress < 100)
            {
                LoadDeployingPackageToUI(args.Package, args.Progress);
            }
            else if (args.Progress == 100 && args.IsComplete)
            {
                RemoveDeployingPackageFromUI(args.Package);

                bool isPresent = false;
                foreach (var control in optionalPackagesList)
                {
                    if (control.Package.Id.FullName.CompareTo(args.Package.Id.FullName) == 0)
                    {
                        isPresent = true;
                    }
                }
                if (!isPresent)
                {
                    LoadPackageToUI(args.Package);
                }
            }
        }