mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05:00
Compare commits
8 Commits
24.10.24
...
f63c312f22
Author | SHA1 | Date | |
---|---|---|---|
f63c312f22 | |||
fcd339d54d | |||
ea2a92fb1e | |||
07b20cd23d | |||
838716e2f4 | |||
7cc5725136 | |||
0ee9972edf | |||
86a0b9bd03 |
@ -248,7 +248,7 @@ function Remove-FileOrDirectory([string]$pathToDelete, [string]$mask = "", [swit
|
|||||||
function New-Unattend {
|
function New-Unattend {
|
||||||
|
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory, Position = 0)] [string] $userName,
|
[Parameter(Mandatory, Position = 0)] [string]$userName,
|
||||||
[Parameter(Position = 1)] [string] $userPassword
|
[Parameter(Position = 1)] [string] $userPassword
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -62,17 +62,33 @@ function Invoke-WPFGetIso {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
if ($sync["ISOoption2"].IsChecked) {
|
||||||
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
# Open file dialog to let user choose the ISO file
|
||||||
$openFileDialog.initialDirectory = $initialDirectory
|
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
||||||
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
||||||
$openFileDialog.ShowDialog() | Out-Null
|
$openFileDialog.initialDirectory = $initialDirectory
|
||||||
$filePath = $openFileDialog.FileName
|
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
||||||
|
$openFileDialog.ShowDialog() | Out-Null
|
||||||
|
$filePath = $openFileDialog.FileName
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($filePath)) {
|
if ([string]::IsNullOrEmpty($filePath)) {
|
||||||
Write-Host "No ISO is chosen"
|
Write-Host "No ISO is chosen"
|
||||||
$sync.BusyMessage.Visibility="Hidden"
|
$sync.BusyMessage.Visibility="Hidden"
|
||||||
return
|
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)"
|
Write-Host "File path $($filePath)"
|
||||||
|
@ -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
|
# Load Checkboxes and Labels outside of the Filter function only once on startup for performance reasons
|
||||||
$filter = Get-WinUtilVariables -Type CheckBox
|
$filter = Get-WinUtilVariables -Type CheckBox
|
||||||
$CheckBoxes = ($sync.GetEnumerator()).where{ $psitem.Key -in $filter }
|
$CheckBoxes = ($sync.GetEnumerator()).where{ $psitem.Key -in $filter }
|
||||||
|
@ -340,6 +340,47 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</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">
|
<Style x:Key="ToggleSwitchStyle" TargetType="CheckBox">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
@ -925,10 +966,14 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Foreground="{LabelboxForegroundColor}"
|
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 Name="WPFGetIso" Margin="2" Padding="15">
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<TextBlock Background="Transparent" Foreground="{ButtonForegroundColor}">
|
<TextBlock Background="Transparent" Foreground="{ButtonForegroundColor}">
|
||||||
Select Windows <Underline>I</Underline>SO
|
Get Windows <Underline>I</Underline>SO
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Button.Content>
|
</Button.Content>
|
||||||
</Button>
|
</Button>
|
||||||
|
Reference in New Issue
Block a user