diff --git a/installer.nsi b/installer.nsi index 412d779a..56ff812d 100644 --- a/installer.nsi +++ b/installer.nsi @@ -107,6 +107,10 @@ Section "${NAME}" INSTALL_SECTION ; Create shortcuts CreateShortcut "$DESKTOP\${NAME}.lnk" "$INSTDIR\Rack.exe" CreateShortcut "$SMPROGRAMS\${NAME}.lnk" "$INSTDIR\Rack.exe" + + ; Add allowed app to Controlled Folder Access + ExpandEnvStrings $0 "%COMSPEC%" + ExecShellWait "" '"$0"' "/C powershell -ExecutionPolicy Bypass -WindowStyle Hidden $\"Add-MpPreference -ControlledFolderAccessAllowedApplications '$INSTDIR\Rack.exe'$\"" SW_HIDE SectionEnd