You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 2.0.1 Reported for operating system, platform: Windows (All), All
Comments on the original bug report:
On 2013-11-26 09:08:33 +0000, Boris Bendovsky wrote:
Created attachment 1476
A patch for the SDL_GetPrefPath
SDL_GetPrefPath creates a path without a name of the organization and a name of the application.
On 2014-02-06 15:10:47 +0000, Mike Parker wrote:
You can take out those two CreateDirectory calls and cut it down to this:
// Build the full path appdata/orgname/appname string as you already do, then:
if( 0xFFFFFFFF == GetFileAttributesW( path )) {
if( SHCreateDirectoryExW( NULL, path, NULL ) != ERROR_SUCCESS ) {
Win_SetError( "Couldn't create the pref path." );
}
}
The call to GetFileAttributes is a test to see if the folder exists. If it doesn't, SHCreateDirectoryEx will create every folder on the path. So you don't have to make separate calls for org name and app name.
On 2014-02-10 12:33:18 +0000, Boris Bendovsky wrote:
(In reply to Mike Parker from comment # 1)
You can take out those two CreateDirectory calls and cut it down to this:
// Build the full path appdata/orgname/appname string as you already do,
then:
if( 0xFFFFFFFF == GetFileAttributesW( path )) {
if( SHCreateDirectoryExW( NULL, path, NULL ) != ERROR_SUCCESS ) {
Win_SetError( "Couldn't create the pref path." );
}
}
The call to GetFileAttributes is a test to see if the folder exists. If it
doesn't, SHCreateDirectoryEx will create every folder on the path. So you
don't have to make separate calls for org name and app name.
Since I didn't find exact minimum Windows requirements (Windows XP, Windows XP SP1, etc.) I used "CreateDirectoryW" for compatibility. "SHCreateDirectoryExW" requires Windows XP with Service Pack 2 to work. Also "It might be altered or unavailable in subsequent versions of Windows" (http://msdn.microsoft.com/en-us/library/windows/desktop/bb762131%28v=vs.85%29.aspx).
On 2014-02-24 16:57:27 +0000, Ryan C. Gordon wrote:
So the CSIDL_FLAG_CREATE doesn't work (or doesn't do what I thought it did)? That flag is supposed to tell SHGetFolderPath() to create the directory if it's missing.
--ryan.
On 2014-02-25 04:11:01 +0000, Mike Parker wrote:
It will create the path associated with CSIDL_APPDATA (User\AppData\Roaming or whatever) if it doesn't exist, but after that you still have to explicitly create the orgname\appname folders.
On 2014-02-28 03:43:09 +0000, Ryan C. Gordon wrote:
(In reply to Mike Parker from comment # 4)
It will create the path associated with CSIDL_APPDATA (User\AppData\Roaming
or whatever) if it doesn't exist, but after that you still have to
explicitly create the orgname\appname folders.
Oh, duh, you're right.
--ryan.
On 2014-03-02 01:29:23 +0000, Ryan C. Gordon wrote:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 2.0.1
Reported for operating system, platform: Windows (All), All
Comments on the original bug report:
On 2013-11-26 09:08:33 +0000, Boris Bendovsky wrote:
On 2014-02-06 15:10:47 +0000, Mike Parker wrote:
On 2014-02-10 12:33:18 +0000, Boris Bendovsky wrote:
On 2014-02-24 16:57:27 +0000, Ryan C. Gordon wrote:
On 2014-02-25 04:11:01 +0000, Mike Parker wrote:
On 2014-02-28 03:43:09 +0000, Ryan C. Gordon wrote:
On 2014-03-02 01:29:23 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: