Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to write to C:\Program Files (x86)\Emarcadero\Dev-Cpp\config\devcpp.ini #24

Closed
sitiom opened this issue Oct 14, 2020 · 12 comments · Fixed by #39
Closed

Unable to write to C:\Program Files (x86)\Emarcadero\Dev-Cpp\config\devcpp.ini #24

sitiom opened this issue Oct 14, 2020 · 12 comments · Fixed by #39

Comments

@sitiom
Copy link
Contributor

sitiom commented Oct 14, 2020

After installing the setup & opening Dev-C++ as non-admin, I get this error:
error
I can safely continue, however, any changes to config will not be saved once I close it.
Workaround is to Run as Admin.

@FMXExpress
Copy link
Collaborator

Are you running under some kind of special account? Or a school/business administrated desktop?

The new default location for the settings file is My Documents\Embarcadero\Dev-Cpp so it's a little odd if it can't access that directory?

@sitiom
Copy link
Contributor Author

sitiom commented Oct 15, 2020

Are you running under some kind of special account? Or a school/business administrated desktop?

Nope.

The new default location for the settings file is My Documents\Embarcadero\Dev-Cpp so it's a little odd if it can't access that directory?

After careful looking, It seems like the location for the settings still resides on Program Files (x86) by default:
image

I have confirmed this by installing it on my other devices and they all defaulted to that directory which caused the error.

@FMXExpress
Copy link
Collaborator

I see that the fix to have config.ini in MyDocuments didn't make it into the release.

@sitiom
Copy link
Contributor Author

sitiom commented Oct 18, 2020

@FMXExpress Doesn't it make more sense to have the config file on the %AppData% folder?

@FMXExpress
Copy link
Collaborator

Apparently not. It is in the %AppData% folder now and not working for you.

@sitiom
Copy link
Contributor Author

sitiom commented Oct 19, 2020

Apparently not. It is in the %AppData% folder now and not working for you.

What? I can't see anything in my AppData and the config resides on the installation directory at Program Files (x86).

@FMXExpress
Copy link
Collaborator

The fallback (and portable) is the current directory. The error is in Program Files it can't create that file without admin permissions. Older versions of Windows didn't require that permission. This leads me to believe it doesn't have permission to use your %APPDATA% directory otherwise it wouldn't be using the fallback.

// default dir should be %APPDATA%\Dev-Cpp
AppData := IncludeTrailingBackslash(GetHomePath);

// Store the INI file in %APPDATA% or if we are not allowed to do so, in the exe directory
if (not devData.IsPortable) and ((AppData <> '') and (DirectoryExists(AppData + 'Embarcadero\Dev-Cpp') or CreateDir(AppData + 'Embarcadero\Dev-Cpp'))) then
  devData.INIFileName := AppData + 'Embarcadero\Dev-Cpp\' + INIFileName
else

http://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.GetHomePath

@zhwuyuhehe
Copy link

I have the same question.
I Iinstalled this https://github.com/Embarcadero/Dev-Cpp/releases/download/v6.0/Embarcadero_Dev-Cpp_6.0_TDM-GCC_9.2_Setup.zip.
When I open it ,I can see this error"0x00241EE4".
My system is Windows 10 LTSC.
1
2

哦,我把这个文件的权限加上了写入就可以了...........
多谢开发者~~~

@sitiom
Copy link
Contributor Author

sitiom commented Oct 19, 2020

// Store the INI file in %APPDATA% or if we are not allowed to do so, in the exe directory
if (not devData.IsPortable) and ((AppData <> '') and (DirectoryExists(AppData + 'Embarcadero\Dev-Cpp') or CreateDir(AppData + 'Embarcadero\Dev-Cpp'))) then
  devData.INIFileName := AppData + 'Embarcadero\Dev-Cpp\' + INIFileName
else

@FMXExpress
Oh, I see the problem now. I have the permission to write to %AppData% but fails to create the Dev-Cpp directory because the Embarcadero directory does not exist. The workaround is to add the Embarcadero folder myself and everything runs fine now.
I hope this helps.

@himself65
Copy link

Just run it on Administrator Mode

@zhwuyuhehe
Copy link

Just run it on Administrator Mode

嗯嗯,也可以,不过感觉给的权限少比较安全,只需要添加一个写入权限即可.不需要让他获取管理员权限.

@himself65
Copy link

Just run it on Administrator Mode

嗯嗯,也可以,不过感觉给的权限少比较安全,只需要添加一个写入权限即可.不需要让他获取管理员权限.

Yes, and I think it's a bug because the App doesn't check to write permission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants