Page 1 of 3

Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-26, 07:31 UTC
by Mooschka
I experienced problem with recognizing user profile directory by Total Commander 9.50. Didn't check earlier version - fresh installation. Windows 10 Pro EN-US), local user name Paweł (with Polish letter ł at the end). During installation, user profile is recognized as Pawel, with l at the end.
After installation, program is unable to write to config files, located in wrong directory. when I will start with admin rights new folder Pawel in C:\Users directory is created.
I tried with English and Polish language in tcmdr, the same.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-26, 09:47 UTC
by ghisler(Author)
This only works when setting the user locale to Poland for non-Unicode programs. Otherwise the ł isn't part of the codepage and cannot be used in ANSI INI file functions. This cannot be fixed on my side.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-27, 05:39 UTC
by MVV
ghisler(Author),
I think TC should only use Unicode API for any file operations, including accessing INI files. You can always convert Unicode string to an ANSI one after reading if needed.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-27, 08:00 UTC
by ghisler(Author)
The problem is that bad things happen when you access an ANSI INI file with Unicode API. One solution would be to convert the INI file to Unicode when it is found in a Unicode-only folder. This would lose compatibility with Windows 9x/ME.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-27, 10:57 UTC
by MVV
Shouldn't GetPrivateProfileStringW+WideCharToMultiByte(CP_ACP) produce the same output as GetPrivateProfileStringA? What kind of bad things may happen?

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-28, 15:12 UTC
by ghisler(Author)
I have no enabled the option myself, and I had no problems reading the INI file even from a direcory with Polish characters. However, I didn't create a profile with Polish letters yet - I just set the ini location with various methods:
1. Started Total commander with parameter /i=c:\test\äöüł\wincmd.ini
2. In registry key HKEY_CURRENT_USER\Software\Ghisler\Total Commander set the value
iniFileName to c:\test\äöüł\wincmd.ini
3. In registry key HKEY_CURRENT_USER\Software\Ghisler\Total Commander set the value
iniFileName to %tcdirectory%wincmd.ini
and set environment variable
%tcdirectory% to c:\test\äöüł\

I tried with both ANSI and Unicode wincmd.ini, it both worked fine!

Could you please check how the location of your wincmd.ini is defined?

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-28, 15:54 UTC
by Usher
2Mooschka
Have you installed Polish language pack for Windows?

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-28, 16:38 UTC
by Mooschka
Usher wrote: 2020-02-28, 15:54 UTC 2Mooschka
Have you installed Polish language pack for Windows?
No, I don't have.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-02-28, 16:59 UTC
by Usher
So do it…

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-01, 07:30 UTC
by ghisler(Author)
I don't have any Polish language pack installed, and it works just fine! So apparently something is configured wrong on Mooschka's PC.

2Mooschka
Could you please do the following:
1. Run regedit.exe
2. Go to HKEY_CURRENT_USER\Software\Ghisler\Total Commander
3. Let me know the value of "iniFileName" in the right panel (just copy and paste it here)

If the value contains a text between percent signs like %APPDATA%, do the following:
4. From menu "Commands", choose "Open command prompt window"
5. Type the following command and press ENTER:
echo %APPDATA%
Note: Please replace the text between percent signs with the one from step 3 above if it is different. %APPDATA% is the most used.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-03, 10:36 UTC
by ghisler(Author)
2Mooschka
Could you please answer my questions? I'm "hanging in the air" without additional information. :(

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-05, 19:11 UTC
by Mooschka
Hi! Sorry for delay. Finally I have installed Windows with adding Microsoft account and the local name is pawel now, so problem disappeared.

I have added new local account Paweł again and I tried to download and install Total Commander. After downloading and start setup I have a got an error: The setup information file was not found!
Screenshot: Image: https://i.imgur.com/krMjLhl.png

After moving install file to other folder installation has started as usual. Fe days ago I have installed from NAS drive.

Registry after installation:
[HKEY_LOCAL_MACHINE\SOFTWARE\Ghisler\Total Commander]
"IniFileName"="%APPDATA%\\GHISLER\\wincmd.ini"
"FtpIniName"="%APPDATA%\\GHISLER\\wcx_ftp.ini"
"InstallDir"="C:\\totalcmd"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ghisler\Total Commander]
"IniFileName"="%APPDATA%\\GHISLER\\wincmd.ini"
"FtpIniName"="%APPDATA%\\GHISLER\\wcx_ftp.ini"
"InstallDir"="C:\\totalcmd"
APPDATA value:
C:\Users\Paweł\AppData\Roaming

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-05, 19:15 UTC
by Mooschka
Usher wrote: 2020-02-28, 16:59 UTCSo do it…
No, this is not a solution. I don't want PL lang pack.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-05, 19:17 UTC
by Mooschka
Other applications, like Notepad++, IrfanView or FileZilla, have created folders in AppData normally.

Re: Ini files in wrong directory (because of Polish letter?)

Posted: 2020-03-06, 16:37 UTC
by ghisler(Author)
So only the installer fails to run from a subdir of C:\Users\Paweł, but Total Commander then runs fine when the settings are under C:\Users\Paweł?