Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Source/exehead/fileform.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,15 @@ const TCHAR * NSISCALL loadHeaders(int cl_flags)

GetModuleFileName(NULL, state_exe_path, NSIS_MAX_STRLEN);

g_db_hFile = db_hFile = myOpenFile(state_exe_path, GENERIC_READ, OPEN_EXISTING);
// Windows Defender blocks reading exe file now and then
for (int i = 0; i < 5; ++i) {
Sleep(i * 200);
g_db_hFile = db_hFile = myOpenFile(state_exe_path, GENERIC_READ, OPEN_EXISTING);
if (db_hFile != INVALID_HANDLE_VALUE)
{
break;
}
}
if (db_hFile == INVALID_HANDLE_VALUE)
{
return _LANG_CANTOPENSELF;
Expand Down