Old 22nd June 2006, 09:08   #1
Nils Schneider
Junior Member
 
Join Date: May 2006
Location: Essen, Germany
Posts: 9
Send a message via ICQ to Nils Schneider Send a message via Yahoo to Nils Schneider
Automatic Uninstall?

Hi,

let's say I've got a folder with savegames that I'm shipping for a game, that I want to install.

Now the user plays the game and also creates some savegames (into the same folder)

When uninstalling, I want the uninstaller to remove the savegames what were shipped with the game, but not the ones that the user created. How do I do that?

Regards,

Nils
Nils Schneider is offline   Reply With Quote
Old 22nd June 2006, 09:38   #2
onad
Senior Member
 
onad's Avatar
 
Join Date: Dec 2004
Location: Turkey
Posts: 447
First of all "(into the same folder)" saving is NOT a good way to store data on your OS. It should be in:

\Documents and Settings\{PLAYUSER}\Application Data\{YOURORGINAZATION}\{YOURAPP}\Savegame

where the {} values are ofcourse variables.

Then it is also easy to maintain, remove just this folder.

see documentation about "RMDir" how to do that.

"Just do it"
onad is offline   Reply With Quote
Old 22nd June 2006, 10:13   #3
Nils Schneider
Junior Member
 
Join Date: May 2006
Location: Essen, Germany
Posts: 9
Send a message via ICQ to Nils Schneider Send a message via Yahoo to Nils Schneider
This is exactly the path we're using. An I know RMDir, but the shipped savegames are installed in exactly the folder you mention, and the user is saving his savegames there, too. So is there a way to remove only the files that have been installed by the installer or isn't this possible?
Nils Schneider is offline   Reply With Quote
Old 22nd June 2006, 10:54   #4
Mr Inches
Member
 
Join Date: Jan 2006
Location: Canberra, Australia
Posts: 76
The only real way I can see to do this is for your installer to record what it installed (including the initial savedgame files).

This is what is commonly called an 'installer log'. The uninstaller simply removes anything that is in the log. The log might also include registry changes and shortcuts added too.

This is how most modern installers handle your problem. It is also why sometimes you see 'some items need to removed manually' messages when uninstalling. The uninstaller is basically saying "Hey! There is some data here that I didn't put there. I guess it must be yours, you decide what to do with it, I'll leave it alone!".

This does mean that your uninstaller cannot count on being able to remove the data directory it created, unless after removing the information it put there, it is empty.

These same ideas apply equally to registry information and shortcuts.

Duncan
Mr Inches is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump