Files
FFU/FFUDevelopment/BuildFFUVM_UI.xaml
T
2025-05-26 11:32:35 -07:00

298 lines
19 KiB
XML

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="FFU Builder UI"
Height="600" Width="900">
<!-- Define ToolTip Style to offset from mouse pointer -->
<Window.Resources>
<Style TargetType="ToolTip">
<Setter Property="Placement" Value="Mouse"/>
<Setter Property="HorizontalOffset" Value="10"/>
<Setter Property="VerticalOffset" Value="-30"/> <!-- Changed from -20 to -30 -->
<!-- Removed OverridesDefaultStyle setter to allow default ToolTip styling -->
</Style>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <!-- New row for Custom VM Switch Name -->
</Grid.RowDefinitions>
<TabControl TabStripPlacement="Left" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" FontSize="14" Padding="10" Grid.Row="0">
<TabItem Header="Basic" Padding="20">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Row 0: FFU Name -->
<RowDefinition Height="Auto"/> <!-- Row 1: FFU Development Path -->
<RowDefinition Height="Auto"/> <!-- Row 2: ISO Path -->
<RowDefinition Height="Auto"/> <!-- Row 3: Windows SKU -->
<RowDefinition Height="Auto"/> <!-- Row 4: VM Switch Name -->
<RowDefinition Height="Auto"/> <!-- Row 5: Custom VM Switch Name -->
<RowDefinition Height="Auto"/> <!-- Row 6: VM Host IP Address -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/> <!-- Increased from 150 to 200 for longer TextBlock -->
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- FFU Name -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="FFU Name:"/>
<Image x:Name="imgFFUNameInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Enter a unique name for the FFU. Example format: {WindowsRelease}_{WindowsVersion}_{SKU}_{yyyy}-{MM}-{dd}_{HH}{mm}" />
</StackPanel>
<TextBox x:Name="txtFFUName" Grid.Row="0" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
<!-- FFU Development Path -->
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="FFU Development Path:"/>
<Image x:Name="imgFFUDevPathInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Defaults to the location the script is run from. It's unlikely this will need to be changed." />
</StackPanel>
<Grid Grid.Row="1" Grid.Column="1" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/> <!-- Reduced width for TextBox -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <!-- Added Column for info image -->
</Grid.ColumnDefinitions>
<TextBox x:Name="txtFFUDevPath" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" />
<Button x:Name="btnBrowseFFUDevPath" Grid.Column="1" Content="Browse..." Width="80" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="Browse for FFU Development folder."/>
<Image x:Name="imgFFUDevPathInfoExtra" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Defaults to the location the script is run from. It's unlikely this will need to be changed." />
</Grid>
<!-- ISO Path -->
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="ISO Path:"/>
<Image x:Name="imgISOPathInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Specify the full path to the Windows ISO file you wish to use." />
</StackPanel>
<!-- Replace StackPanel with Grid for better alignment -->
<Grid Grid.Row="2" Grid.Column="1" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="txtISOPath" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" />
<Button x:Name="btnBrowseISO" Grid.Column="1" Content="Browse..." Width="80" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="Browse for a Windows ISO file."/>
</Grid>
<!-- Windows SKU -->
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="Windows SKU:"/>
<Image x:Name="imgWindowsSKUInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Select the edition of Windows you want to install (e.g., Pro, Enterprise)." />
</StackPanel>
<ComboBox x:Name="cmbWindowsSKU" Grid.Row="3" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
<!-- VM Switch Name -->
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="VM Switch Name:"/>
<Image x:Name="imgVMSwitchNameInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Enter the name of the Hyper-V virtual switch to be used for the VM." />
</StackPanel>
<!-- Replace TextBox with ComboBox for listing VM Switches -->
<ComboBox x:Name="cmbVMSwitchName" Grid.Row="4" Grid.Column="1" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Stretch" />
<!-- Add a new TextBox for custom VM Switch Name, initially hidden -->
<TextBox x:Name="txtCustomVMSwitchName" Grid.Row="5" Grid.Column="1" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Visibility="Collapsed"
ToolTip="Enter your custom VM Switch Name." />
<!-- VM Host IP Address -->
<StackPanel Grid.Row="6" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5">
<TextBlock Text="VM Host IP Address:"/>
<Image x:Name="imgVMHostIPAddressInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Provide the IP address of the Hyper-V host machine." />
</StackPanel>
<TextBox x:Name="txtVMHostIPAddress" Grid.Row="6" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
</Grid>
</TabItem>
<TabItem Header="Applications" Padding="20">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Install Apps -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkInstallApps" Content="Install Apps" Margin="0,0,5,0"/>
<Image x:Name="imgInstallAppsInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True"
ToolTip="Check to include additional applications in the FFU." />
</StackPanel>
<!-- ...existing application-related controls... -->
</Grid>
</TabItem>
<!-- New M365 Apps/Office Tab -->
<TabItem Header="M365 Apps/Office" Padding="20">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Install Office -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkInstallOffice" Content="Install Office" Margin="0,0,5,0"/>
<Image x:Name="imgInstallOfficeInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True"
ToolTip="Check to install Microsoft Office as part of the FFU." />
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="Drivers" Padding="20">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Row 0: Install Drivers -->
<RowDefinition Height="Auto"/> <!-- Row 1: Copy Drivers -->
<RowDefinition Height="Auto"/> <!-- Row 2: Download Drivers -->
<RowDefinition Height="Auto"/> <!-- Row 3: Make/Model -->
<RowDefinition Height="Auto"/> <!-- Row 4: Drivers Folder -->
<RowDefinition Height="Auto"/> <!-- Row 5: Copy PE Drivers -->
<RowDefinition Height="Auto"/> <!-- Row 6: PE Drivers Folder -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Install Drivers -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkInstallDrivers" Content="Install Drivers" Margin="0,0,5,0"/>
<Image x:Name="imgInstallDriversInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True"
ToolTip="Uses dism to service the drivers directly to the FFU. Recommended if making a FFU for a single model type." />
</StackPanel>
<!-- Copy Drivers -->
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkCopyDrivers" Content="Copy Drivers" Margin="0,0,5,0"/>
<Image x:Name="imgCopyDriversInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True"
ToolTip="Copy the drivers folder to the Drivers folder on the USB deploy partition. This is recommended if you have multiple models and you're using a single FFU. When deploying the FFU you'll be prompted to select which drivers you want to use." />
</StackPanel>
<!-- Download Drivers -->
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkDownloadDrivers" Content="Download Drivers" Margin="0,0,5,0"/>
<Image x:Name="imgDownloadDriversInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True"
ToolTip="Check to download drivers automatically." />
</StackPanel>
<!-- Make & Model Section -->
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" x:Name="spMakeModelSection" Visibility="Collapsed" Margin="0">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Make -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="5">
<TextBlock x:Name="txtMakeLabel" Text="Make:" VerticalAlignment="Center" />
<Image x:Name="imgMakeInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
ToolTip="Select the device manufacturer." />
</StackPanel>
<ComboBox x:Name="cmbMake" Grid.Row="0" Grid.Column="1" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
<!-- Model -->
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Margin="5">
<TextBlock x:Name="txtModelLabel" Text="Model:" VerticalAlignment="Center"/>
<Image x:Name="imgModelInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
ToolTip="Enter the device model." />
</StackPanel>
<TextBox x:Name="cmbModel" Grid.Row="1" Grid.Column="1" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
</Grid>
</StackPanel>
<!-- Drivers Folder -->
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" Margin="5">
<TextBlock Text="Drivers Folder:" VerticalAlignment="Center"/>
<Image x:Name="imgDriversFolderInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Specify the path to the Drivers folder." />
</StackPanel>
<Grid Grid.Row="4" Grid.Column="1" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="txtDriversFolder" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" />
<Button x:Name="btnBrowseDriversFolder" Grid.Column="1" Content="Browse..." Width="80" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="Browse for Drivers folder."/>
</Grid>
<!-- Copy PE Drivers moved to Row 5 -->
<StackPanel Grid.Row="5" Grid.Column="0" Orientation="Horizontal" Margin="5">
<CheckBox x:Name="chkCopyPEDrivers" Content="Copy PE Drivers" Margin="0,0,5,0"/>
<Image x:Name="imgCopyPEDriversInfo" Source="$infoImagePath" Width="16" Height="16" Cursor="Arrow"
Focusable="True" ToolTip="Check to copy local PE Drivers folder to the build." />
</StackPanel>
<!-- PE Drivers Folder moved to Row 6 -->
<StackPanel Grid.Row="6" Grid.Column="0" Orientation="Horizontal" Margin="5">
<TextBlock Text="PE Drivers Folder:" VerticalAlignment="Center"/>
<Image x:Name="imgPEDriversFolderInfo" Source="$infoImagePath" Width="16" Height="16" Margin="5,0,0,0" Cursor="Arrow"
Focusable="True"
ToolTip="Specify the path to the PE Drivers folder." />
</StackPanel>
<Grid Grid.Row="6" Grid.Column="1" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="txtPEDriversFolder" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" />
<Button x:Name="btnBrowsePEDrivers" Grid.Column="1" Content="Browse..." Width="80" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="Browse for PE Drivers folder."/>
</Grid>
</Grid>
</TabItem>
</TabControl>
<!-- Progress Bar -->
<ProgressBar x:Name="progressBar" Height="20" Margin="0,10,0,0" Grid.Row="1" Visibility="Collapsed"
/>
<!-- Status Text -->
<TextBlock x:Name="txtStatus" Grid.Row="2" Text="" Margin="0,5,0,0"
/>
<!-- Run Button Row -->
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,20,20">
<!-- New Build Config File Button -->
<Button x:Name="btnBuildConfig" Content="Build Config File" Width="150"
VerticalAlignment="Bottom" Margin="0,0,10,0" FontSize="14" Padding="10,5"/>
<!-- Existing Build FFU Button -->
<Button x:Name="btnRun" Content="Build FFU" Width="120"
VerticalAlignment="Bottom" FontSize="14" Padding="10,5"/>
</StackPanel>
</Grid>
</Window>