* use 'Windows Defender' substring to identify proper checkbox

https://github.com/espressif/esp-idf/issues/4225
This commit is contained in:
Martin Vychodil 2020-01-03 15:27:22 +01:00
parent 3c5190aefc
commit bc43d48ec9
2 changed files with 13 additions and 2 deletions

View file

@ -302,7 +302,16 @@ begin
Log('CheckWinDefenderAvailable: ' + szHasWD);
WizardForm.TasksList.ItemEnabled[1] := bHasWD;
WizardForm.TasksList.Checked[1] := bHasWD;
{ WD registration checkbox is identified by 'Windows Defender' substring anywhere in its caption.
Please, keep this in mind when making changes }
for x:=0 to (WizardForm.TasksList.Items.Count-1) do
begin
if Pos('Windows Defender', WizardForm.TasksList.ItemCaption[x]) > 0 then
begin
WizardForm.TasksList.ItemEnabled[x] := bHasWD;
WizardForm.TasksList.Checked[x] := bHasWD;
break;
end;
end;
end;
end;

View file

@ -79,6 +79,8 @@ Type: files; Name: "{autodesktop}\{#IDFCmdExeShortcutFile}"
[Tasks]
Name: createlnk; Description: "Create Start Menu shortcut for the ESP-IDF Tools Command Prompt";
Name: createdsk; Description: "Create Desktop shortcut for the ESP-IDF Tools Command Prompt";
; WD registration checkbox is identified by 'Windows Defender' substring anywhere in its caption, not by the position index in WizardForm.TasksList.Items
; Please, keep this in mind when making changes to the item's description - WD checkbox is to be disabled on systems without the Windows Defender installed
Name: wdexcl; Description: "Register the ESP-IDF Tools executables as Windows Defender exclusions (improves compilation speed, requires elevation)";
[Run]