Skip to content

Commit da465e5

Browse files
committed
No more custom ScratchPaths!
Time to get rid of that mess and just use %TEMP%. All of these minor changes were made on a Server 2K8R2 VM.
1 parent 29525de commit da465e5

File tree

4 files changed

+2
-83
lines changed

4 files changed

+2
-83
lines changed

functions/microwin/Invoke-MicrowinGetIso.ps1

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,6 @@ function Invoke-MicrowinGetIso {
221221
# there is probably a better way of doing this, I don't have time to figure this out
222222
$sync.MicrowinIsoDrive.Text = $driveLetter
223223

224-
$mountedISOPath = (Split-Path -Path "$filePath")
225-
if ($sync.MicrowinScratchDirBox.Text.Trim() -eq "Scratch") {
226-
$sync.MicrowinScratchDirBox.Text =""
227-
}
228-
229-
$UseISOScratchDir = $sync.WPFMicrowinISOScratchDir.IsChecked
230-
231-
if ($UseISOScratchDir) {
232-
$sync.MicrowinScratchDirBox.Text=$mountedISOPath
233-
}
234-
235-
if( -Not $sync.MicrowinScratchDirBox.Text.EndsWith('\') -And $sync.MicrowinScratchDirBox.Text.Length -gt 1) {
236-
237-
$sync.MicrowinScratchDirBox.Text = Join-Path $sync.MicrowinScratchDirBox.Text.Trim() '\'
238-
239-
}
240-
241224
# Detect if the folders already exist and remove them
242225
if (($sync.MicrowinMountDir.Text -ne "") -and (Test-Path -Path $sync.MicrowinMountDir.Text)) {
243226
try {
@@ -256,13 +239,8 @@ function Invoke-MicrowinGetIso {
256239
$randomMicrowinScratch = "MicrowinScratch_${timestamp}_${randomNumber}"
257240
$sync.BusyText.Text=" - Mounting"
258241
Write-Host "Mounting Iso. Please wait."
259-
if ($sync.MicrowinScratchDirBox.Text -eq "") {
260-
$mountDir = Join-Path $env:TEMP $randomMicrowin
261-
$scratchDir = Join-Path $env:TEMP $randomMicrowinScratch
262-
} else {
263-
$scratchDir = $sync.MicrowinScratchDirBox.Text+"Scratch"
264-
$mountDir = $sync.MicrowinScratchDirBox.Text+"micro"
265-
}
242+
$mountDir = Join-Path $env:TEMP $randomMicrowin
243+
$scratchDir = Join-Path $env:TEMP $randomMicrowinScratch
266244

267245
$sync.MicrowinMountDir.Text = $mountDir
268246
$sync.MicrowinScratchDir.Text = $scratchDir

functions/public/Invoke-ScratchDialog.ps1

Lines changed: 0 additions & 28 deletions
This file was deleted.

functions/public/Invoke-WPFButton.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ function Invoke-WPFButton {
5959
"WPFGetIso" {Invoke-MicrowinGetIso}
6060
"WPFMicrowin" {Invoke-Microwin}
6161
"WPFCloseButton" {Invoke-WPFCloseButton}
62-
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
6362
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
6463
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
6564
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}

xaml/inputXML.xaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,35 +1355,6 @@
13551355
Check the status in the console
13561356
</TextBlock>
13571357
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
1358-
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}" ToolTip="Scratch directories act as a custom destination for image files"><Bold>Scratch directory settings (optional)</Bold></TextBlock>
1359-
<CheckBox x:Name="WPFMicrowinISOScratchDir" Content="Use ISO directory for ScratchDir " IsChecked="False" Margin="{DynamicResource MicrowinCheckBoxMargin}"
1360-
ToolTip="Check this to use the path of the ISO file you specify as a scratch directory" />
1361-
<Grid>
1362-
<Grid.ColumnDefinitions>
1363-
<ColumnDefinition Width="*" /> <!-- Takes the remaining space -->
1364-
<ColumnDefinition Width="30" /> <!-- Fixed width for Button -->
1365-
</Grid.ColumnDefinitions>
1366-
<TextBox Name="MicrowinScratchDirBox" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
1367-
Text="Scratch"
1368-
Margin="2"
1369-
IsReadOnly="False"
1370-
ToolTip="Specify an alternate path for the scratch directory"
1371-
Grid.Column="0"
1372-
VerticalAlignment="Center"
1373-
Foreground="{DynamicResource LabelboxForegroundColor}">
1374-
</TextBox>
1375-
<Button Name="MicrowinScratchDirBT"
1376-
Width="Auto"
1377-
Height="Auto"
1378-
Grid.Column="1"
1379-
Margin="2"
1380-
Padding="1" VerticalAlignment="Center">
1381-
<Button.Content>
1382-
...
1383-
</Button.Content>
1384-
</Button>
1385-
</Grid>
1386-
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
13871358
<TextBox Name="MicrowinFinalIsoLocation" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
13881359
Text="ISO location will be printed here"
13891360
Margin="2"
@@ -1457,7 +1428,6 @@
14571428
<CheckBox Name="MicrowinImportDrivers" Content="Import drivers from current system" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Export all third-party drivers from your system and inject them to the MicroWin image"/>
14581429
<CheckBox Name="MicrowinCopyVirtIO" Content="Include VirtIO drivers" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy VirtIO Guest Tools drivers to your ISO file. Check this only if you want to use it on QEMU/Proxmox VE"/>
14591430
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
1460-
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
14611431
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Custom user settings (leave empty for default user)</Bold></TextBlock>
14621432
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">User name (20 characters max.):</TextBlock>
14631433
<TextBox Name="MicrowinUserName" Background="Transparent" BorderThickness="1" BorderBrush="{DynamicResource MainForegroundColor}"

0 commit comments

Comments
 (0)