Added M365 Apps/Office tab

This commit is contained in:
rbalsleyMSFT
2024-12-31 00:07:00 -08:00
committed by rbalsleyMSFT
parent eb3212ee2d
commit b422a565d5
2 changed files with 89 additions and 9 deletions
+67
View File
@@ -352,6 +352,9 @@ $btnBuildConfig.Add_Click({
})
# After loading the window:
# Initialize script-scoped variable
$script:installAppsCheckedByOffice = $false
$window.Add_Loaded({
$script:vmSwitchMap = @{}
$script:cmbVMSwitchName = $window.FindName('cmbVMSwitchName')
@@ -557,6 +560,70 @@ $window.Add_Loaded({
# Set default values for Drivers Folder and PE Drivers Folder
$window.FindName('txtDriversFolder').Text = Join-Path -Path $FFUDevelopmentPath -ChildPath "Drivers"
$window.FindName('txtPEDriversFolder').Text = Join-Path -Path $FFUDevelopmentPath -ChildPath "PEDrivers"
# Find the Install Office and Install Apps checkboxes
$script:chkInstallOffice = $window.FindName('chkInstallOffice')
$script:chkInstallApps = $window.FindName('chkInstallApps')
# Add event handler for Install Office Checked
$script:chkInstallOffice.Add_Checked({
if (-not $script:chkInstallApps.IsChecked) {
$script:chkInstallApps.IsChecked = $true
$script:installAppsCheckedByOffice = $true
}
$script:chkInstallApps.IsEnabled = $false
})
# Add event handler for Install Office Unchecked
$script:chkInstallOffice.Add_Unchecked({
if ($script:installAppsCheckedByOffice) {
$script:chkInstallApps.IsChecked = $false
$script:installAppsCheckedByOffice = $false
}
$script:chkInstallApps.IsEnabled = $true
})
# Initialize additional script-scoped variables
$script:installAppsCheckedManually = $false
# Assign script-scoped variables
$script:chkInstallOffice = $window.FindName('chkInstallOffice')
$script:chkInstallApps = $window.FindName('chkInstallApps')
# ...assign other script-scoped variables...
# Add event handler for Install Apps Checked manually
$script:chkInstallApps.Add_Checked({
if (-not $script:installAppsCheckedByOffice) {
# User checked Install Apps manually
$script:installAppsCheckedManually = $true
}
})
# Add event handler for Install Apps Unchecked manually
$script:chkInstallApps.Add_Unchecked({
if (-not $script:installAppsCheckedByOffice) {
# User unchecked Install Apps manually
$script:installAppsCheckedManually = $false
}
})
# Add event handler for Install Office Checked
$script:chkInstallOffice.Add_Checked({
if (-not $script:chkInstallApps.IsChecked) {
$script:chkInstallApps.IsChecked = $true
$script:installAppsCheckedByOffice = $true
}
$script:chkInstallApps.IsEnabled = $false
})
# Add event handler for Install Office Unchecked
$script:chkInstallOffice.Add_Unchecked({
if ($script:installAppsCheckedByOffice) {
$script:chkInstallApps.IsChecked = $false
$script:installAppsCheckedByOffice = $false
}
$script:chkInstallApps.IsEnabled = $true
})
})
# Show the window
+22 -9
View File
@@ -123,6 +123,27 @@
<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>
@@ -137,17 +158,9 @@
Focusable="True"
ToolTip="Check to install Microsoft Office as part of the FFU." />
</StackPanel>
<!-- Install Apps -->
<StackPanel Grid.Row="1" 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>
<TabItem Header="Drivers" Padding="20">
<Grid Margin="10">
<Grid.RowDefinitions>