@AndreasFSC @mucho may be interested
I am trying to move Userdata to the local folder.
Why?
Older version of Race 07 and earlier games had Userdata in the game folder.
The files could be accessed, read, created and modified using relative paths.
First, I copied config.ini to devfiles folder, because it can be deleted by the game.
I have tested some config files in batch
I wrote a short .cmd file
(dot = here)
(once again for the next init)
After exit from config, the game should start.
I tested config files for
RFactor, GTR2, Race07 early, STCC1, BMW M3 Challenge.
These are games where the Userdata folder is a subfolder of the game.
Running config.exe don't create user files neither in documents nor in local folders... and the game doesn't start in batch.
The user folder in documents is created by the game .exe file.
The game must be started manually, then the settings are copied to documents from config.ini
STCC 2 config is the first one that creates User folder in documents by itself.
The game starts in batch.
The only disadvantage is that the track maps in game are blue (it doesn't support skins).
Volvo config is the only that creates a folder with the Application info name.
The game starts automatically in batch.
and it also creates one more folder, Race 07 install ##
So we have two remote folders, instead of one, it is worse.
RaceRemaster config is from Volvo the Game. The files differ only by text GameinstallDir replaced with GameinstallOrg to differentiate the original user files from the Remaster files.
Back to the original GTR Evo config.
Remember to delete the user folder from documents every time the .cmd is started.
line 6061 - change:
to
(five random chars)
and the first occurrence in this line of
(binary zero, NUL)
to
Remote folder is no longer created by config, but it is created by the starting game, still in Documents\SimBin\Race 07 install ##.
We find the same sequence in the game .exe in line 21509
Replace the same chars and save as a new file.
If we edit .exe in Notepad++, it must be saved as "All types", not any other text document.
Successful, UserData folder has been created in
not in
The goal is to create it in game folders, to access the files by relative links.
One more try. Replace in both files (config.exe and game .exe)
with
(the same length)
User folder named UserdataABCDE
is still created by config in documents
but without a subfolder.
The starting game adds files to this folder.
Better.
Now a question.
Can we share the same user folder for all installs of Race 07?
Copying:
config.exe config.ini game.exe and the .cmd file
to another installed R07.
Will a number be added?
This time not deleting the user folder from documents.
Unfortunately, the number has been added
the new folder is
Deleting both user folders.
Now we have two ways.
Get rid of the numbers, use one folder for all installs
or
Try to move userdata out of Documents.
change to
created the folder in the root of the drive, where Documents are located
Folder name is preceeded by Documents folder name
Worse.
System variables... will it understand?
replacing
with
Fail.
%__CD__% that means "current directory" should create a folder UserAB in the game folder, where we want.
But no, it was interpreted as plain text, and created a folder UserAB in the folder named:
Reverting to the safest
The Userdata folder is created in Documents\Userdata\User
The first change to
did nothing, because the current folder was changed to Documents before.
Before creating the user folder, the exe somewhere does
If the current folder was not changed before, the Userdata folder would be created in the same location as the game.
Not this way. I have to find how the game obtains the location of documents and replace it with current folder.
Be careful with these .\ and ..\
Some constructions may create undeletable folders.
The game code uses variables, but how to use them?
Variables are defined only as types %s = string %d = decimal and other types,
but where are the initial values?
Some values are read from .ini files. Other values are modified from game menu, but we are talking about the very init of the game, before the menu starts.
Pause for today....
This is the interesting part in config.exe, the same sequence is repeated in game exe.
I am trying to move Userdata to the local folder.
Why?
Older version of Race 07 and earlier games had Userdata in the game folder.
The files could be accessed, read, created and modified using relative paths.
First, I copied config.ini to devfiles folder, because it can be deleted by the game.
I have tested some config files in batch
I wrote a short .cmd file
Code:
@echo off
copy devfiles\config.ini .
Code:
echo Running Config
config.exe
echo Running the Game
Race_Steam.exe
copy devfiles\config.ini .
Code:
exit /b
After exit from config, the game should start.
I tested config files for
RFactor, GTR2, Race07 early, STCC1, BMW M3 Challenge.
These are games where the Userdata folder is a subfolder of the game.
Running config.exe don't create user files neither in documents nor in local folders... and the game doesn't start in batch.
The user folder in documents is created by the game .exe file.
The game must be started manually, then the settings are copied to documents from config.ini
STCC 2 config is the first one that creates User folder in documents by itself.
The game starts in batch.
The only disadvantage is that the track maps in game are blue (it doesn't support skins).
Volvo config is the only that creates a folder with the Application info name.
The game starts automatically in batch.
and it also creates one more folder, Race 07 install ##
So we have two remote folders, instead of one, it is worse.
RaceRemaster config is from Volvo the Game. The files differ only by text GameinstallDir replaced with GameinstallOrg to differentiate the original user files from the Remaster files.
Back to the original GTR Evo config.
Remember to delete the user folder from documents every time the .cmd is started.
line 6061 - change:
Code:
SimBin\RACE 07
Code:
Userdata\ABCDE
and the first occurrence in this line of
Code:
GameinstallDir=0
to
Code:
GameinstallDir=.
Remote folder is no longer created by config, but it is created by the starting game, still in Documents\SimBin\Race 07 install ##.
We find the same sequence in the game .exe in line 21509
Replace the same chars and save as a new file.
If we edit .exe in Notepad++, it must be saved as "All types", not any other text document.
Successful, UserData folder has been created in
Code:
Documents\UserData\ABCDE
Code:
Documents\SimBin\Race 07 install ##
The goal is to create it in game folders, to access the files by relative links.
One more try. Replace in both files (config.exe and game .exe)
Code:
\Userdata\ABCDE
Code:
.\UserdataABCDE
User folder named UserdataABCDE
is still created by config in documents
but without a subfolder.
The starting game adds files to this folder.
Better.
Now a question.
Can we share the same user folder for all installs of Race 07?
Copying:
config.exe config.ini game.exe and the .cmd file
to another installed R07.
Will a number be added?
This time not deleting the user folder from documents.
Unfortunately, the number has been added
the new folder is
Code:
Documents\UserdataABCDE install 2
Deleting both user folders.
Now we have two ways.
Get rid of the numbers, use one folder for all installs
or
Try to move userdata out of Documents.
change to
Code:
UserdataABCDEFG
Folder name is preceeded by Documents folder name
Code:
DocumentsUserDataABCDEFG
System variables... will it understand?
replacing
Code:
UserDataABCDEFG
Code:
%__CD__%\UserAB
%__CD__% that means "current directory" should create a folder UserAB in the game folder, where we want.
But no, it was interpreted as plain text, and created a folder UserAB in the folder named:
Code:
Documents%__CD__%
Reverting to the safest
Code:
.\Userdata\User
The first change to
Code:
GameinstallDir=.
Before creating the user folder, the exe somewhere does
Code:
cd documents
Not this way. I have to find how the game obtains the location of documents and replace it with current folder.
Be careful with these .\ and ..\
Some constructions may create undeletable folders.
The game code uses variables, but how to use them?
Variables are defined only as types %s = string %d = decimal and other types,
but where are the initial values?
Some values are read from .ini files. Other values are modified from game menu, but we are talking about the very init of the game, before the menu starts.
Pause for today....
This is the interesting part in config.exe, the same sequence is repeated in game exe.