0 registered members (),
744
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Prevent Game Crash
[Re: Rei_Ayanami]
#397035
03/13/12 19:37
03/13/12 19:37
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hows about this? It is just an idea, so you will need to test yourself.
Once you are about to do the save, try opening and closing a dummy file with the EXACT same path and filename, but use the function FILE_OPEN_WRITE(). If it SUCESSFULLY opens (ie returns NOT zero), then you have the rights. If it FAILS (ie returns a zero), then you are unable to save here(not admin?).
Im just not sure if this will trigger a windows error/warning if you are not admin.
Also beware, you may need to delete the dummy file(file_delete) before you actually save. And when doing this make DOUBLY sure you give file_open_write the COMPLETE file-path.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Prevent Game Crash
[Re: MasterQ32]
#397074
03/14/12 08:14
03/14/12 08:14
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
Manual says: Saving files into the program folder requires administrator rights under Windows Vista and above, and is thus not recommended. Use this string to set a different folder, f.i. in the ProgramData directory.
http://www.conitec.net/beta/asave_dir.htm
no science involved
|
|
|
|