Deleting PlayerPrefs and PersistentDataPath content on uninstalling? (Steam)


We are porting one of our games to Steam. When uploaded our first test build we have realized that the uninstall feature does not clean registry for PlayerPrefs neither empty the Persistent Data folder.
Is there any way to configure this on SteamWorks console or Unity itself? Any workaround or clue is welcome.

Thanks in advance and have a nice day.

Unity doesn't provide a direct way to uninstall PlayerPrefs, although that would be a really nice feature :)

Instead you'll have to manually delete the key(s) from the Windows Registry as part of you uninstall script, in which you'll probably want some 3rd part tool to accomplish (sorry I don't know how uninstalling works with Steam).

Theoretically you could use Unity to build an "uninstall app" which calls PlayerPrefs.DeleteAll() but that's probably more trouble than it's worth.

1 Like

Thanks a lot for your reply.

If someone else has faced this question please feel free to share your ideas.

Thank you

Looking at the SteamWorks documentation it is possible to include an install script to perform certain actions (e.g. run a batch file) on uninstall.
This could be used to both remove the registry keys that PlayerPrefs writes to, as well as clearing out certain folders.

1 Like

Thanks for your reply Julien. Will check this.