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 create directory" message in the launcher #719

Open
rybakolbasa opened this Issue Jun 28, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@rybakolbasa

rybakolbasa commented Jun 28, 2018

What is wrong

Hi everybody!

I downloaded the latest JA2S for Win, installed it, and ran the launcher to set the data directory and resolution. Then I ran the game from the launcher and got this:

2018/05/28 17:56:39 ERROR [File Man ] Unable to create tmp directory 'C:\%userprofile%\Documents\JA2\tmp'
where %userprofile% is my Windows user account in Users.

Apparently, the game does not run.

There is no tmp folder at the above path. Creating it manually does not help. There is, however, the json file in the /JA2 with the settings I entered in the launcher. The data_dir points to the folder where JA2 is installed (not to the Data folder).

{
  "data_dir": "D:\\games\\Jagged Alliance 2",
  "mods": [],
  "res": "1280x720",
  "resversion": "ENGLISH",
  "fullscreen": false,
  "debug": false,
  "nosound": false
}

The %userprofile% contains some Russian symbols. I tried to change the temp/tmp environment vars systemwide to something ASCII-only, but to no avail. The launcher still looks for the old path.

The original version of the game starts ok.

Also, for some reason the date stamp in the error log displays May, not June.

JA2S version Game version Vanilla bug? Used to work?
0.16.1 JA2 GOG English no yes/no

OS=Windows 8/64

Any thoughts?

@selaux

This comment has been minimized.

Show comment
Hide comment
@selaux

selaux Jul 15, 2018

Member

Hi, sorry for the late response. Can you try to reproduce this with version 0.15.1? This will give us a hint where to look for the issue.

Member

selaux commented Jul 15, 2018

Hi, sorry for the late response. Can you try to reproduce this with version 0.15.1? This will give us a hint where to look for the issue.

@selaux

This comment has been minimized.

Show comment
Hide comment
@selaux

selaux Jul 15, 2018

Member

NB: You need to follow the "Without the optional launcher" instructions from here, as the old version does not have the launcher yet: https://ja2-stracciatella.github.io/how-to-run/

Member

selaux commented Jul 15, 2018

NB: You need to follow the "Without the optional launcher" instructions from here, as the old version does not have the launcher yet: https://ja2-stracciatella.github.io/how-to-run/

@rybakolbasa

This comment has been minimized.

Show comment
Hide comment
@rybakolbasa

rybakolbasa Jul 18, 2018

@selaux No problem, I've waited like 15 years already, so a couple of weeks is nothing :)

Here is what I get with 0.15.1:

---------------------------
Jagged Alliance 2
---------------------------
ERROR: caught unhandled exception:
boost::filesystem::directory_iterator::construct: Системе не удается найти указанный путь: "\data"
---------------------------
ОК   
---------------------------

This means "The system cannot find the specified path".

Here are the contents of the JA2.ini:
[Ja2 Settings] CD=c #Tells ja2-stracciatella where the binary datafiles are located data_dir = "d:\games\Jagged Alliance 2\"

Apparently, the path is correct, the original game is installed where the path says, and there is the Data folder in it with all the files within.

The console reports the following before the exception occurs:

WARNING: Could not open configuration file ("C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.
ini").
Please edit "C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.ini" to point to the binary data
.
------------------------------------------------------------------------------
Configuration file:            'C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.ini'
Root game resources directory: ''
Extra data directory:          'D:\games\Jagged Alliance 2\JA2 Stracciatella'
Data directory:                '\data'
Tilecache directory:           '\data\tilecache'
Saved games directory:         'C:\Users\─ьшЄЁшщ\Documents\JA2\SavedGames'
------------------------------------------------------------------------------
ERROR: caught unhandled exception:
boost::filesystem::directory_iterator::construct: ╤шёЄхьх эх єфрхЄё  эрщЄш єърчр
ээ√щ яєЄ№: "\data"

Symbols in the user profile name is my user name in Russian. It does not display in the consolde due to some charset issues I guess.

After I close the message, the JA2.ini is then gets edited automatically with some placeholder path inserted into the data_dir parameter. I suppose this means, the program actually CAN open the configuration file despite what the warning says.

rybakolbasa commented Jul 18, 2018

@selaux No problem, I've waited like 15 years already, so a couple of weeks is nothing :)

Here is what I get with 0.15.1:

---------------------------
Jagged Alliance 2
---------------------------
ERROR: caught unhandled exception:
boost::filesystem::directory_iterator::construct: Системе не удается найти указанный путь: "\data"
---------------------------
ОК   
---------------------------

This means "The system cannot find the specified path".

Here are the contents of the JA2.ini:
[Ja2 Settings] CD=c #Tells ja2-stracciatella where the binary datafiles are located data_dir = "d:\games\Jagged Alliance 2\"

Apparently, the path is correct, the original game is installed where the path says, and there is the Data folder in it with all the files within.

The console reports the following before the exception occurs:

WARNING: Could not open configuration file ("C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.
ini").
Please edit "C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.ini" to point to the binary data
.
------------------------------------------------------------------------------
Configuration file:            'C:\Users\─ьшЄЁшщ\Documents\JA2\ja2.ini'
Root game resources directory: ''
Extra data directory:          'D:\games\Jagged Alliance 2\JA2 Stracciatella'
Data directory:                '\data'
Tilecache directory:           '\data\tilecache'
Saved games directory:         'C:\Users\─ьшЄЁшщ\Documents\JA2\SavedGames'
------------------------------------------------------------------------------
ERROR: caught unhandled exception:
boost::filesystem::directory_iterator::construct: ╤шёЄхьх эх єфрхЄё  эрщЄш єърчр
ээ√щ яєЄ№: "\data"

Symbols in the user profile name is my user name in Russian. It does not display in the consolde due to some charset issues I guess.

After I close the message, the JA2.ini is then gets edited automatically with some placeholder path inserted into the data_dir parameter. I suppose this means, the program actually CAN open the configuration file despite what the warning says.

@selaux

This comment has been minimized.

Show comment
Hide comment
@selaux

selaux Jul 19, 2018

Member

I debugged a little this morning, could reproduce it by returning a static path C:\─ьшЄЁшщ from rusts get_stracciatella_home and it indeed seems like an encoding issue. The paths we use are encoded in utf8 and boost seems to expect the native windows encoding. I suspect this has never worked, can somebody confim this?

A little bit of technical detail: I can get the correct std::wstring using UTF8String.getWCHAR() but I have no idea how to get it into FileMan using the correct encoding. Constructing a std::string from the std::wstring data it didn't work as well. My guess is that this does not work because the wstring then contains a \0 byte in the middle and boost filesystem can't handle that, but it also could still be a wrong encoding (at least in the debugger it showed correctly). I think to fix that we need to rewrite some of the FileMan logic to support the proper encodings in the right places and not just use std::string or char* everywhere...

Member

selaux commented Jul 19, 2018

I debugged a little this morning, could reproduce it by returning a static path C:\─ьшЄЁшщ from rusts get_stracciatella_home and it indeed seems like an encoding issue. The paths we use are encoded in utf8 and boost seems to expect the native windows encoding. I suspect this has never worked, can somebody confim this?

A little bit of technical detail: I can get the correct std::wstring using UTF8String.getWCHAR() but I have no idea how to get it into FileMan using the correct encoding. Constructing a std::string from the std::wstring data it didn't work as well. My guess is that this does not work because the wstring then contains a \0 byte in the middle and boost filesystem can't handle that, but it also could still be a wrong encoding (at least in the debugger it showed correctly). I think to fix that we need to rewrite some of the FileMan logic to support the proper encodings in the right places and not just use std::string or char* everywhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment