Переглянути джерело

* use 'Windows Defender' substring to identify proper checkbox
https://github.com/espressif/esp-idf/issues/4225

Martin Vychodil 6 роки тому
батько
коміт
bc43d48ec9

+ 11 - 2
tools/windows/tool_setup/idf_setup.iss.inc

@@ -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;

+ 2 - 0
tools/windows/tool_setup/idf_tool_setup.iss

@@ -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]