Skip to content

Commit

Permalink
Fix: The language file wasn't loaded quite soon enough.
Browse files Browse the repository at this point in the history
Fix: The program would crash if no language files were present. It now shows an appropriate error dialog.
Fix: The InnoSetup installer wasn't creating the Data folder properly
  • Loading branch information
leezer3 committed Jun 22, 2016
1 parent cf0a493 commit 0d929f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test "$TRAVIS_OS_NAME" == "osx" && hdiutil create OpenBVE-$(date '+%F').dmg -volname "OpenBVE" -fs HFS+ -srcfolder "OpenBVE.app"
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test "$TRAVIS_OS_NAME" == "osx" && sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "OpenBVE-$(date '+%F').dmg" $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
#Release build
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "osx" && hdiutil create openBVE-$($TRAVIS_TAG).dmg -volname "openBVE" -fs HFS+ -srcfolder "OpenBVE.app"
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "osx" && sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "openBVE-$($TRAVIS_TAG).dmg" $DEPLOY_USER@$DEPLOY_HOST:$RELEASE_PATH
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "osx" && hdiutil create openBVE-$TRAVIS_TAG.dmg -volname "openBVE" -fs HFS+ -srcfolder "OpenBVE.app"
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_TAG && test "$TRAVIS_OS_NAME" == "osx" && sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "openBVE-$TRAVIS_TAG.dmg" $DEPLOY_USER@$DEPLOY_HOST:$RELEASE_PATH
addons:
apt:
packages:
Expand Down
4 changes: 2 additions & 2 deletions WindowsInstaller/openbve.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "openBVE"
#define MyAppVersion "1.5.0.1"
#define MyAppVersion "1.5.0.2"
#define MyAppPublisher "Christopher Lees"
#define MyAppURL "http://www.openbve-project.net"
#define MyAppExeName "OpenBve.exe"
Expand Down Expand Up @@ -46,7 +46,7 @@ Source: "C:\Program Files (x86)\openBVE\OpenBveApi.xml"; DestDir: "{app}"; Flags
Source: "C:\Program Files (x86)\openBVE\OpenTK.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files (x86)\openBVE\OpenTK.dll.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files (x86)\openBVE\SharpCompress.Unsigned.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files (x86)\openBVE\Data\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Program Files (x86)\openBVE\Data\*"; DestDir: "{app}\Data"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand Down
27 changes: 18 additions & 9 deletions openBVE/OpenBve/System/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ private static void Main(string[] args) {
options.Backend = PlatformBackend.PreferNative;
}
Toolkit.Init(options);
// --- load language ---
{
string folder = Program.FileSystem.GetDataFolder("Languages");
try
{
string[] LanguageFiles = Directory.GetFiles(folder, "*.cfg");
foreach (var File in LanguageFiles)
{
Interface.AddLanguage(File);
}
}
catch
{
MessageBox.Show(@"An error occured whilst attempting to load the default language files.");
//Environment.Exit(0);
}
}
Interface.LoadControls(null, out Interface.CurrentControls);
{
string folder = Program.FileSystem.GetDataFolder("Controls");
Expand All @@ -139,15 +156,7 @@ private static void Main(string[] args) {
Interface.LoadControls(file, out controls);
Interface.AddControls(ref Interface.CurrentControls, controls);
}
// --- load language ---
{
string folder = Program.FileSystem.GetDataFolder("Languages");
string[] LanguageFiles = Directory.GetFiles(folder, "*.cfg");
foreach (var File in LanguageFiles)
{
Interface.AddLanguage(File);
}
}

// --- check the command-line arguments for route and train ---
formMain.MainDialogResult result = new formMain.MainDialogResult();
for (int i = 0; i < args.Length; i++) {
Expand Down

0 comments on commit 0d929f4

Please sign in to comment.