only accept install directory if empty?
I'm working on creating an installation package for a program in a community I'm in, first time working with NSIS in awhile. I came across the issue that I have a lot of files and so thus I'm using recursive method for File to install the files, but this creates the problem that I can't single out just the installation files during uninstallation. I've looked at a couple of solutions like Advanced Uninstall Log and it might work, but it does have the problem of some performance problems especially if there's a lot of files in the selected installation directory. I was trying to think of something that would be easy to implement primarily to avoid things like if the user decided to install directly to Programs Files or something as the documentation suggests that if a user did so and your script just used RMDir /r to remove it, it could wipe out all their files. So my idea outside of the logging scripts would be to simply check if a directory was empty before installation, and I'd prefer this method anyway, and prevent installation otherwise. I'm just getting into reviewing if something like this was possible but it doesn't appear to be easily done, anyone have any good examples or solutions for doing this? Any tips for how I can manage to safely handle the uninstallation process in my situation?
BTW, current steps I'm at are trying to find a way to verify if a directory is empty, and finding a way to prevent the installer from advancing passed the directory page (using MUI2) if it's not. I also wonder why NSIS just doesn't have some more stringent safety checks or way of monitoring this built in, it would be extremely useful..
Thank you...