Skip to content

Commit d8d61eb

Browse files
committed
Add inffo that OpenRails must be closed for export.
Includes an unrelated change. The check for an INI file path was inconsistent, using EndsWith for input and Contains for output.
1 parent e10390b commit d8d61eb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Source/Contrib/SettingsExporter/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int Main(string[] args)
6767
// determine where to load from
6868
if (fromArg.Equals("INI")) { loadFilePath = SettingsBase.DefaultSettingsFileName; }
6969
else if (fromArg.Equals("REG")) { loadRegistryKey = SettingsBase.DefaultRegistryKey; }
70-
else if (fromArg.EndsWith(".ini")) { loadFilePath = fromArg; }
70+
else if (fromArg.Contains(".ini")) { loadFilePath = fromArg; }
7171
else { loadRegistryKey = fromArg; }
7272

7373
// check that source exists
@@ -212,6 +212,8 @@ static void ShowHelp()
212212
Console.WriteLine(" <to> Specify the destination to save the settings to. Similar to <from>.");
213213
Console.WriteLine(" /h, /help Show this help.");
214214
Console.WriteLine();
215+
Console.WriteLine("Important: Close all OpenRails instances before exporting the settings. Otherwise the exported settings may be stale.");
216+
Console.WriteLine();
215217
Console.WriteLine("This utility reads the Settings (Options) from one location, and exports them to another location.");
216218
Console.WriteLine("It creates a backup of any settings that will be overwritten. Example:");
217219
Console.WriteLine(" <installfolder>\\OpenRails.ini.bak");

Source/Documentation/Manual/appendices.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,9 @@ The Settings Exporter is accessible from the "Tools" button in the main window.
750750
The Settings Exporter may also be used to create a backup of the settings, or to copy the settings from
751751
the INI file back into the registry.
752752

753+
Important: Close all OpenRails instances before exporting the settings.
754+
Otherwise the exported settings may be stale.
755+
753756
Alternatively, create an empty file "OpenRails.ini" in the same folder as "OpenRails.exe" and start Open Rails.
754757
The program will attempt to load settings from the file, using default values for settings that
755758
cannot be found and populates the INI file with these settings.

0 commit comments

Comments
 (0)