mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Added warning before removing Microsoft Store
This commit is contained in:
@@ -75,6 +75,14 @@ function ShowAppSelectionForm {
|
|||||||
# saveButton eventHandler
|
# saveButton eventHandler
|
||||||
$handler_saveButton_Click=
|
$handler_saveButton_Click=
|
||||||
{
|
{
|
||||||
|
if ($selectionBox.CheckedItems -contains "Microsoft.WindowsStore" -and -not $Silent) {
|
||||||
|
$warningSelection = [System.Windows.Forms.Messagebox]::Show('Are you sure you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.', 'Are you sure?', 'YesNo', 'Warning')
|
||||||
|
|
||||||
|
if ($warningSelection -eq 'No') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$global:SelectedApps = $selectionBox.CheckedItems
|
$global:SelectedApps = $selectionBox.CheckedItems
|
||||||
|
|
||||||
# Create file that stores selected apps if it doesn't exist
|
# Create file that stores selected apps if it doesn't exist
|
||||||
@@ -84,6 +92,7 @@ function ShowAppSelectionForm {
|
|||||||
|
|
||||||
Set-Content -Path "$PSScriptRoot/CustomAppsList" -Value $global:SelectedApps
|
Set-Content -Path "$PSScriptRoot/CustomAppsList" -Value $global:SelectedApps
|
||||||
|
|
||||||
|
$form.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
||||||
$form.Close()
|
$form.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +228,6 @@ function ShowAppSelectionForm {
|
|||||||
|
|
||||||
$button1.TabIndex = 4
|
$button1.TabIndex = 4
|
||||||
$button1.Name = "saveButton"
|
$button1.Name = "saveButton"
|
||||||
$button1.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
|
||||||
$button1.UseVisualStyleBackColor = $True
|
$button1.UseVisualStyleBackColor = $True
|
||||||
$button1.Text = "Confirm"
|
$button1.Text = "Confirm"
|
||||||
$button1.Location = New-Object System.Drawing.Point(27,472)
|
$button1.Location = New-Object System.Drawing.Point(27,472)
|
||||||
|
|||||||
Reference in New Issue
Block a user