Esempio n. 1
0
        private void SetVariables(WimMetadataViewModel wimMetadataViewModel)
        {
            if (wimMetadataViewModel is null)
            {
                Requirements[Requirement.WimFile]       = null;
                Requirements[Requirement.WimImageIndex] = null;
                return;
            }

            Requirements[Requirement.WimFile]       = wimMetadataViewModel.Path;
            Requirements[Requirement.WimImageIndex] = wimMetadataViewModel.SelectedDiskImage.Index;
        }
Esempio n. 2
0
        private WimMetadataViewModel LoadWimMetadata(string path)
        {
            Log.Verbose("Trying to load WIM metadata file at '{ImagePath}'", path);

            using (var file = fileSystemOperations.OpenForRead(path))
            {
                var imageReader      = new WindowsImageMetadataReader();
                var windowsImageInfo = imageReader.Load(file);
                if (windowsImageInfo.Images.All(x => x.Architecture != Architecture.Arm64))
                {
                    throw new InvalidWimFileException(Resources.WimFileNoValidArchitecture);
                }

                var vm = new WimMetadataViewModel(windowsImageInfo, path);

                Log.Verbose("WIM metadata file at '{ImagePath}' retrieved correctly", path);

                return(vm);
            }
        }