Compare commits

...

2 Commits

Author SHA1 Message Date
125e78be96 refractor PR
- remove "Segoe Fluent Icons" changes
- add Invoke-WPFGetIso improvements from #2731
> read image once, then take info from the result of that.
2024-11-02 00:04:19 +01:00
affedd3cab [FEAT] change/add some icons
- change settings & close icon to new one using "Segoe Fluent Icons" fontfamily
- add icons to search context menu using "Segoe Fluent Icons" fontfamily
2024-11-01 21:18:16 +01:00

View File

@ -260,19 +260,33 @@ function Invoke-WPFGetIso {
$wimFile = $wimFile.Replace(".wim", ".esd").Trim() $wimFile = $wimFile.Replace(".wim", ".esd").Trim()
} }
$sync.MicrowinWindowsFlavors.Items.Clear() $sync.MicrowinWindowsFlavors.Items.Clear()
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
# Store the results of Get-WindowsImage in a variable
$images = Get-WindowsImage -ImagePath $wimFile
$proEditionIndex = -1
$proeditionfound = $false
# Populate the list of Windows flavors and find the Pro edition
$images | ForEach-Object {
$imageIdx = $_.ImageIndex $imageIdx = $_.ImageIndex
$imageName = $_.ImageName $imageName = $_.ImageName
$sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName")
}
$sync.MicrowinWindowsFlavors.SelectedIndex = 0 # Check if the image name contains 'Pro'
Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want." if ($imageName -like "*Pro*" -and !$proeditionfound) {
Get-WindowsImage -ImagePath $wimFile | ForEach-Object { $proEditionIndex = $imageIdx
if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") { $proeditionfound = $true
# We have found the Pro edition
$sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1
} }
} }
# Set the selected index to the Pro edition if found, otherwise default to the first item
if ($proEditionIndex -ne -1) {
$sync.MicrowinWindowsFlavors.SelectedIndex = $proEditionIndex - 1
} else {
$sync.MicrowinWindowsFlavors.SelectedIndex = 0
}
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....." Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."