I'm using inno setup where user can choose the directory to install the software.exe.
But currently halfway through the installation, Windows Defender would delete/quarantine the exe file as it think it's a virus. My current fix was to create a folder, whitelist the folder in defender then run setup and install to that folder manually.
Is there a way to automate this process in Inno Setup, where after user chose the install directory, it would whitelist that folder before installing?
I saw a few people running Powershell script, but how do I run this script after Inno setup create the folder, and before installing the .exe?
Assuming that you create the directory using
Dirs
section entry, useAfterInstall
parameter to tun your custom code to execute a PowerShell:Though changing users antivirus settings is imo an unacceptable security breach. Fix your application not to be detected as virus instead.