Compare commits

...

8 Commits

Author SHA1 Message Date
f63c312f22 remove architecture selection 2024-08-20 23:07:14 +02:00
fcd339d54d fix (maybe?) 2024-08-19 22:16:39 +02:00
ea2a92fb1e Merge branch 'main' into microwinisodownloader 2024-08-19 21:51:52 +02:00
07b20cd23d fix some stuff 2024-08-19 21:47:48 +02:00
838716e2f4 little update 2024-08-19 21:28:57 +02:00
7cc5725136 change back to using Fido 2024-08-19 21:22:26 +02:00
0ee9972edf little fix 2024-08-19 06:15:06 +02:00
86a0b9bd03 try1 2024-08-17 20:33:11 +02:00
4 changed files with 94 additions and 12 deletions

View File

@ -62,6 +62,8 @@ function Invoke-WPFGetIso {
}
}
if ($sync["ISOoption2"].IsChecked) {
# Open file dialog to let user choose the ISO file
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.initialDirectory = $initialDirectory
@ -74,6 +76,20 @@ function Invoke-WPFGetIso {
$sync.BusyMessage.Visibility="Hidden"
return
}
} elseif ($sync["ISOoption1"].IsChecked) {
# Auto download newest ISO
# Credit: https://github.com/pbatard/Fido
$fidopath = "$env:temp\Fido.ps1"
$originalLocation = Get-Location
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
# TODO: Have to correct the language to actually be a working one
Set-Location -Path $env:temp
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64"
Set-Location $originalLocation
$filePath = Get-ChildItem -Path "$env:temp" -Filter "Win11*.iso" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
}
Write-Host "File path $($filePath)"
if (-not (Test-Path -Path "$filePath" -PathType Leaf)) {

View File

@ -356,6 +356,27 @@ Add-Type @"
})
$locale = (Get-Culture).Name
$sync["ISORelease"].Items.Add("23H2")
$sync["ISORelease"].Items.Add("22H2")
$sync["ISORelease"].Items.Add("21H2")
$sync["ISORelease"].SelectedItem = "23H2"
$sync["ISOLanguage"].Items.Add($locale)
if ($locale -ne "en-US") {
$sync["ISOLanguage"].Items.Add("en-US")
}
$sync["ISOLanguage"].SelectedItem = $locale
if ($sync["ISOoption1"].IsChecked) {
$sync["ISORelease"].Visibility = [System.Windows.Visibility]::Visible
$sync["ISOLanguage"].Visibility = [System.Windows.Visibility]::Visible
} else {
$sync["ISORelease"].Visibility = [System.Windows.Visibility]::Collapsed
$sync["ISOLanguage"].Visibility = [System.Windows.Visibility]::Collapsed
}
# Load Checkboxes and Labels outside of the Filter function only once on startup for performance reasons
$filter = Get-WinUtilVariables -Type CheckBox
$CheckBoxes = ($sync.GetEnumerator()).where{ $psitem.Key -in $filter }

View File

@ -340,6 +340,47 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton">
<Setter Property="Foreground" Value="{MainForegroundColor}"/>
<Setter Property="Background" Value="{MainBackgroundColor}"/>
<Setter Property="FontSize" Value="{FontSize}" />
<Setter Property="FontFamily" Value="{FontFamily}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<StackPanel Orientation="Horizontal" Margin="{CheckBoxMargin}">
<Grid Width="14" Height="14">
<Ellipse x:Name="OuterCircle"
Stroke="{ButtonBackgroundPressedColor}"
Fill="{ButtonBackgroundColor}"
StrokeThickness="1"
Width="14"
Height="14"
SnapsToDevicePixels="True"/>
<Ellipse x:Name="InnerCircle"
Fill="{MainForegroundColor}"
Width="8"
Height="8"
Visibility="Collapsed"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
<ContentPresenter Margin="4,0,0,0"
VerticalAlignment="Center"
RecognizesAccessKey="True"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="InnerCircle" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="OuterCircle" Property="Stroke" Value="{BorderColor}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToggleSwitchStyle" TargetType="CheckBox">
<Setter Property="Template">
<Setter.Value>
@ -925,10 +966,14 @@
TextWrapping="Wrap"
Foreground="{LabelboxForegroundColor}"
/>
<RadioButton x:Name="ISOoption1" Content="Get newest ISO automatically" GroupName="Options" IsChecked="True"/>
<ComboBox x:Name="ISORelease"/>
<ComboBox x:Name="ISOLanguage"/>
<RadioButton x:Name="ISOoption2" Content="Select your own ISO" GroupName="Options"/>
<Button Name="WPFGetIso" Margin="2" Padding="15">
<Button.Content>
<TextBlock Background="Transparent" Foreground="{ButtonForegroundColor}">
Select Windows <Underline>I</Underline>SO
Get Windows <Underline>I</Underline>SO
</TextBlock>
</Button.Content>
</Button>