예제 #1
0
        public void ModifyInstaller()
        {
            try
            {
                StaticViewModel.IsLoading = true;
                StaticViewModel.AddLogMessage("Modifying installer");

                foreach (PackageModel package in PackageList.InstallerPackages.Where(p => !p.Keep))
                {
                    PackageListModel.RemovePackage(package);
                }

                foreach (ScheduledTaskXmlModel task in ScheduledTaskList.ScheduledTasks)
                {
                    ScheduledTaskXmlListModel.SetScheduledTaskStatusAndUnhide(task);
                }

                DisplayComponentList.RemoveComponentsNotKeeping();

                ReadFromExtractedInstaller();

                StaticViewModel.AddLogMessage("Finished modifying installer");
            }
            catch (Exception ex)
            {
                StaticViewModel.AddLogMessage(ex, "Modifying installer failed");
            }
            finally
            {
                StaticViewModel.IsLoading = false;
            }
        }
예제 #2
0
        public void ReadFromExtractedInstaller()
        {
            try
            {
                StaticViewModel.IsLoading = true;
                StaticViewModel.AddLogMessage("Loading installer information");

                DirectoryInfo extractedDirectory = new DirectoryInfo(InstallerFiles.ExtractedInstallerDirectory);
                PackageList.LoadOrRefresh(extractedDirectory);
                ScheduledTaskList.LoadOrRefresh(extractedDirectory);
                DisplayComponentList.LoadOrRefresh(extractedDirectory.FullName);

                StaticViewModel.AddLogMessage("Finished loading installer information");
            }
            catch (Exception ex)
            {
                StaticViewModel.AddLogMessage(ex, "Reading from extracted installer location failed");
            }
            finally
            {
                StaticViewModel.IsLoading = false;
            }
        }