Reputation: 161
I am building a setup using NSIS. In my setup, i need to delete a folder (and its contents) in the windows %appdata%
(or %programdata%
in win7) on uninstallation of my application.
As i am relatively new to NSIS, Kindly Requesting you for a Function or a piece of script that i can use in my setup to execute this operation.
Upvotes: 0
Views: 2940
Reputation: 425
For local user only:
RMDir /r "$APPDATA\YourApp"
RMDir /r "$LOCALAPPDATA\YourApp"
For all users:
SetShellVarContext all
RMDir /r "$APPDATA\YourApp"
RMDir /r "$LOCALAPPDATA\YourApp"
SetShellVarContext current
/r
- required to delete subfolders./REBOOTOK
- required for delayed removal (after system restart).To delete files only use:
Delete "$APPDATA\YourApp\*.*"
Upvotes: 8