I made a game which is saving and reading properties (lifes, level etc.). It works when I have my game on my desktop, but when I create an instalation file and then when I install this game on (C:/Program Files/MyGame) location - it doesn’t work. I use Python script to save and read properties from (file.txt). I think it might be because of this line, but I have no idea what is wrong and how to figure out it: open (path + “file.txt”…
Maybe I should use something else than (path)? I tried to manually change value in (file.txt) in folder with the game but there was “Access denied” window. Maybe Blender also have no access to open, wright, and save any value in any file in this folder when game is installed?
Please help me if you have an idea what could I do to fix this problem.
Microsoft made the “C:\Program Files” directory and its sub-directories non-writable for security reasons. You need admin privileges to copy files there. For this reason the Windows version of Blender uses the “C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender” directory for storing user preferences and installed add-ons. For an example on how to access the “AppData\Roaming” directory with Python, see this post: