3DMMForever icon indicating copy to clipboard operation
3DMMForever copied to clipboard

update the default save location

Open willbr opened this issue 2 years ago • 0 comments

I think we should change the default save location to Documents.

Currently, it defaults to creating a user folder under C\Program Files\. However, this isn't allowed in modern windows.

image

Window's creates a VirtualStore to be backwards compatible, but it's hidden from the user.

C:\Users\wjbr\AppData\Local\VirtualStore\Program Files (x86)\Microsoft Kids\USERS\wjbr

Here's where it sets up the folders. https://github.com/foone/3DMMForever/blob/79b301091175459dd39ec53bbb8a711248e969c6/src/studio/utest.cpp#L1152-L1157

We can use SHGetFolderPath or SHGetKnownFolderPath to get the path of the Documents folder.

 HRESULT result = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, myDocuments);

https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath

willbr avatar Aug 30 '23 18:08 willbr