At first I thought that calling 'delete $INSTDIR\save.file' as the user (not as admin) would make Windows delete the file from virtualstore. But since the following code does not work, apparently I was wrong in that assumption:
!insertmacro UAC.CallFunctionAsUser un.DeleteSaves
Function un.DeleteSaves
Delete /REBOOTOK "$INSTDIR\record.save"
FunctionEnd My question now is, is there a way to tell windows to delete the VirtualStore version of a file, instead of the file that the path would normally point to? (Note that in my case record.save only exists in VirtualStore and it still doesn't get deleted.) Or could NSIS be made to have a variable $VIRTUALINSTDIR that points to the instdir inside virtualstore?I could of course get $INSTDIR and do a number of loops to cut out the xxx part from "C:\Program Files\xxx" and put it into "$APPDATA\Local\VirtualStore\Program Files\xxx", but that seems like the long way around to me.