gak/gravit — Issue #38: Windows: do not write into program directory
Author: FrMo
Created: 2012-01-03 18:23:09+00:00
State: open

For security reasons, a windows program should not create files into the installation path (C:\program files\gravit\save etc.)
similar to linux and MacOS, gravit should use some kind of "home" directory for saving simulations, screenshots, and the stdout.txt / stderr.txt files.

A location in the users profile path should be used, for example C:\Users\\Documents\gravit.

Issues:

* The "documents and settings" folder can be moved:
http://www.w7forums.com/change-location-my-documents-folder-t338.html

* The path name is different between XP and vista/win7 (http://en.wikipedia.org/wiki/My_Documents)

* on XP, the path name depends on the language of windows

possible solutions:

* SCREENSHOT_PATH and SAVE_PATH can be changed in gravit.h
what about the location of stdout.txt and stderr.txt ???

* getenv("USERPROFILE") ==> "C:\Users\Frank"

* http://en.wikipedia.org/wiki/My_Documents :
>An application can convert environment strings in a user-supplied path (e.g. "%USERPROFILE%\My Documents\") to an actual path by (for example) calling the function ExpandEnvironmentStrings.