Skip to content
⌘ NSIS Forum Archive

Pls help ..... Can we find out the modefied file during uninstall

5 posts

shruthi.j#

Pls help ..... Can we find out the modefied file during uninstall

Hi,
I have a doubt can we find out the file been modified by user during uninstallation and stop the uninstaller from deleting that files.

thanks,
shruthi
Afrow UK#
Surely if the user has a file open then it will be locked and will not be deletable. Just don't use /REBOOTOK.

Stu
shruthi.j#
/REBOOTOK is not used but steel the file been modified by the user is getting deleted.

Section "Uninstall"

Call un.DeleteEnvStr
; Remove files and uninstaller
Delete $INSTDIR\uninstall.exe
RMDIR /r "$INSTDIR\*.*"
RMDIR /r "$INSTDIR\*"

SectionEnd

The above code will delete even the modified files and the files not installed by the installer also.

Can u help with alternative code, pls.........
Afrow UK#
You should not use RMDir /r $INSTDIR. What if the user installs to C:\? The operating system and everything else will be deleted.

You must only uninstall what files were installed, either by using individual Delete instructions, or one of the following:



Only the first of these two allows you to use File /r.
Neither of them however allow you to only delete files that have not been modified by the user.

Stu