Compare commits

..

1 Commits

Author SHA1 Message Date
MyDrift
1c197e69f6
Merge affedd3cab into ce1ef2a519 2024-11-01 22:39:58 +01:00
3 changed files with 28 additions and 29 deletions

View File

@ -19,7 +19,7 @@
"IconFontSize": "14",
"IconButtonSize": "35",
"SettingsIconFontSize": "18",
"CloseIconFontSize": "18",
"CloseIconFontSize": "12",
"MicroWinLogoSize": "10",
"MicrowinCheckBoxMargin": "-10,5,0,0",
"GroupBorderBackgroundColor": "#232629",

View File

@ -260,33 +260,19 @@ function Invoke-WPFGetIso {
$wimFile = $wimFile.Replace(".wim", ".esd").Trim()
}
$sync.MicrowinWindowsFlavors.Items.Clear()
# 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 {
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
$imageIdx = $_.ImageIndex
$imageName = $_.ImageName
$sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName")
# Check if the image name contains 'Pro'
if ($imageName -like "*Pro*" -and !$proeditionfound) {
$proEditionIndex = $imageIdx
$proeditionfound = $true
}
$sync.MicrowinWindowsFlavors.SelectedIndex = 0
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."
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") {
# 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
Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."

View File

@ -617,9 +617,22 @@
<ControlTemplate TargetType="ContextMenu">
<Border Background="{DynamicResource MainBackgroundColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="5" Padding="5">
<StackPanel>
<MenuItem Command="Cut" Header="Cut"/>
<MenuItem Command="Copy" Header="Copy"/>
<MenuItem Command="Paste" Header="Paste"/>
<MenuItem Command="Cut" Header="Cut">
<MenuItem.Icon>
<TextBlock Text="&#xE8C6;" FontSize="14" FontFamily="Segoe Fluent Icons"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="Copy" Header="Copy">
<MenuItem.Icon>
<TextBlock Text="&#xE8C8;" FontSize="14" FontFamily="Segoe Fluent Icons"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="Paste" Header="Paste">
<MenuItem.Icon>
<TextBlock Text="&#xE77F;" FontSize="14" FontFamily="Segoe Fluent Icons"/>
</MenuItem.Icon>
</MenuItem>
</StackPanel>
</Border>
</ControlTemplate>
@ -874,7 +887,7 @@
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="5,5,5,0"
FontFamily="Segoe MDL2 Assets"
FontFamily="Segoe Fluent Icons"
Content="&#xE713;"/>
<Popup Grid.Column="3" Name="SettingsPopup"
IsOpen="False"
@ -901,13 +914,13 @@
<Button
Grid.Column="4"
Content="&#xD7;" BorderThickness="0"
Content="&#xE8BB;" BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,5,5,0"
FontFamily="{DynamicResource FontFamily}"
FontFamily="Segoe Fluent Icons"
Foreground="{DynamicResource MainForegroundColor}" FontSize="{DynamicResource CloseIconFontSize}" Name="WPFCloseButton" />
</Grid>