tags:

views:

113

answers:

1

Hi folks, Inno setup question here...

I'm making a program which should be installed globally for all users, but where each user has his own specific settings for the program, which should definitely not be shared. To pull this off in a way which works well in Windows 7, I made the program itself create a folder under {userappdata} to store its settings in. However, I would like the setup to be able to do a clean uninstall, which would mean that my uninstaller (ran as admin, of course) needs to delete the folder for each user that has it.

Does anyone have any idea how I could do this? I'm stumped...

+1  A: 

You could have the application record the users for which it has created a configuration file, then put the deletion logic in either your main program or a utility application and run it at uninstall-time via inno's [UninstallRun] Filename: "{app}\WHATEVER.EXE"; Parameters: "/uninstall".

Another approach would be to have your main app dynamically append details to an uninstall bat/vbs installed in the application dir and run that.

The only other way I can think of to do this is to use Pascal scripting in the uninstall event.

Alex K.
Well, the Pascal scripting was actually what I was looking for, but I don't seem to find a way to get a users list, or even with one, to reliably get these folders for all users.Your idea isn't too bad though. I could put that in the shared user app folder. Maybe I'll do something like that.I can't believe this sort of issue isn't more common with global installs, tbh.
Nyerguds
Pascal scripting could read an ini file (GetIniString) your app appends to [InstalledFor] \r\n bob=c:\users\bob
Alex K.
I meant Pascal scripting WITHOUT any changes to the program. Just going over all users, seeing if the folder in appdata exists, and removing it.Anyway, I implemented the current solution; on startup, the program now adds the user's settings folder to a list in a file nested in the "All Users\Appdata" folder (well, only if it's not in it already, of course). Now I have to wait for the results from my Win7 tester, to see if multiple users can indeed use manipulate that file correctly... anyway, thanks for the help :)
Nyerguds
Well, it seems to work perfectly. Thanks!
Nyerguds