Skip to content

Commit

Permalink
Don't delete old uninstaller if it points somewhere else
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7394 212acab6-be3b-0410-9dea-997c60f758d6
  • Loading branch information
sredna committed Jun 3, 2023
1 parent d9661aa commit c40cf78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/exehead/Main.c
Expand Up @@ -376,10 +376,10 @@ EXTERN_C void NSISWinMainNOCRT()

if (ec)
{
// Delete previous uninstaller
if (DeleteFile(unexe))
// Delete previous uninstaller (if it is safe to do so)
if (!(GetFileAttributes(unexe) & FILE_ATTRIBUTE_REPARSE_POINT) && DeleteFile(unexe))
{
myDelete(state_temp_dir, DEL_DIR|DEL_RECURSE);
myDelete(state_temp_dir, DEL_DIR);
if (!retry++) goto retry_un_dir;
}
}
Expand Down

0 comments on commit c40cf78

Please sign in to comment.