mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Added warning before removing Microsoft Store
This commit is contained in:
@@ -75,6 +75,14 @@ function ShowAppSelectionForm {
|
||||
# saveButton eventHandler
|
||||
$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
|
||||
|
||||
# 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
|
||||
|
||||
$form.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
||||
$form.Close()
|
||||
}
|
||||
|
||||
@@ -157,7 +166,7 @@ function ShowAppSelectionForm {
|
||||
|
||||
if (-not $jobDone) {
|
||||
# Show error that the script was unable to get list of apps from winget
|
||||
[System.Windows.MessageBox]::Show('Unable to load list of installed apps via winget, some apps may not be displayed in the list.','Error','Ok','Error')
|
||||
[System.Windows.MessageBox]::Show('Unable to load list of installed apps via winget, some apps may not be displayed in the list.', 'Error', 'Ok', 'Error')
|
||||
}
|
||||
else {
|
||||
# Add output of job (list of apps) to $listOfApps
|
||||
@@ -219,7 +228,6 @@ function ShowAppSelectionForm {
|
||||
|
||||
$button1.TabIndex = 4
|
||||
$button1.Name = "saveButton"
|
||||
$button1.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
||||
$button1.UseVisualStyleBackColor = $True
|
||||
$button1.Text = "Confirm"
|
||||
$button1.Location = New-Object System.Drawing.Point(27,472)
|
||||
|
||||
Reference in New Issue
Block a user