From 17a441ec8e1aebc2977989bb08a929e7a8851edb Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Wed, 6 May 2020 09:44:53 +0300 Subject: [PATCH] Disable crash reporting (#826) * disable jit debugger * override settings asfter vs installation --- images/win/Windows2016-Azure.json | 6 ++++++ images/win/Windows2019-Azure.json | 6 ++++++ .../scripts/Installers/Disable-JITDebugger.ps1 | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 images/win/scripts/Installers/Disable-JITDebugger.ps1 diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 834de3afb..506073423 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -944,6 +944,12 @@ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" + ] + }, { "type": "powershell", "inline": [ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 1b3e5f74f..2a89973ef 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -947,6 +947,12 @@ "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" + ] + }, { "type": "powershell", "inline": [ diff --git a/images/win/scripts/Installers/Disable-JITDebugger.ps1 b/images/win/scripts/Installers/Disable-JITDebugger.ps1 new file mode 100644 index 000000000..1ae5d21bc --- /dev/null +++ b/images/win/scripts/Installers/Disable-JITDebugger.ps1 @@ -0,0 +1,16 @@ +Write-Host "Disable Just-In-Time Debugger" + +# Turn off Application Error Debugger +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Value "-" -Type String -Force + +# Turn off the Debug dialog +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force +New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework" -Name DbgManagedDebugger -Value "-" -Type String -Force + +# Disable the WER UI +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Type DWORD -Force +# Send all reports to the user's queue +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name ForceQueue -Value 1 -Type DWORD -Force +# Default consent choice 1 - Always ask (default) +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" -Name DefaultConsent -Value 1 -Type DWORD -Force \ No newline at end of file