MantisBT - VCMI
View Issue Details
0001688VCMIOtherpublic2014-02-08 12:432022-04-12 11:19
0001688: On Windows vcmi must store user-specific data under C:\Users directory
As in summary, all data that can be changed by user (saves, config files, some temporary files) should be stored in user-specific directory (IIRC this is C:\Users\<user name>\...)

This is already works as intended on other OS's, to make this work on Win somebody must implement appropriate methods in lib/VCMIDirs.h/cpp

Creating this report mostly because we've got some bugs that require this feature to be implemented first.
No tags attached.
related to 0001685closed Ivan If we use mod to change config/settings.json, all option changes are saved to that file 
related to 0001310closed Ivan Linux XDG support for savegames 
related to 0001733closed Ivan Launcher changing resolution option doesn't work. 
Issue History
2014-02-08 12:43IvanNew Issue
2014-02-08 12:43IvanStatusnew => assigned
2014-02-08 12:43IvanAssigned To => Tow
2014-02-08 12:44IvanRelationship addedrelated to 0001685
2014-02-08 12:44IvanRelationship addedrelated to 0001310
2014-02-27 13:58IvanRelationship addedrelated to 0001733
2014-02-27 20:50TowNote Added: 0004539
2014-02-27 20:51TowNote Edited: 0004539bug_revision_view_page.php?bugnote_id=4539#r2541
2016-09-30 16:05SXXNote Added: 0006786
2016-09-30 16:05SXXStatusassigned => resolved
2016-09-30 16:05SXXFixed in Version => 0.99
2016-09-30 16:05SXXResolutionopen => fixed
2016-09-30 16:05SXXAssigned ToTow => SXX
2022-04-12 11:19PovelitelStatusresolved => closed

2014-02-27 20:50   
(edited on: 2014-02-27 20:51)
I've done quick'n'dirty implementation for this in r3783.

The thing I'm concerned about is that this uses non-UTF (local system encoding) strings, while generally everything should be UTF8. [Otherwise, having strings with different encoding in the project will sooner or later cause trouble.]

However, Windows doesn't use UTF8 and standard library objects like ifstream apparently require paths to be in the non-UTF encoding.
The fix for this is:
a) set global locale to utf8
b) imbue boost::filesystem::path with that locale
c) replace all std::ofstream with boost::filesystem::ofstream (same for ifstream)
d) put globally the following pragma, so MSVC compiler knows that files are utf8
#pragma execution_character_set("utf-8")

Ugh… Not before release.

2016-09-30 16:05   
Pretty sure that even if we had any issues remaining they were solved by this PR: [^]