diff --git a/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml
index 8c04ea48b..028c6e43f 100644
--- a/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml
+++ b/tools/installer/TRX_InstallerLib/Controls/FinishStepControl.xaml
@@ -6,7 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="clr-namespace:TRX_InstallerLib.Models"
d:DataContext="{d:DesignInstance Type=models:FinishStep}"
- mc:Ignorable="d"
+ mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
@@ -14,19 +14,17 @@
-
- Step 4: Done
-
+
-
- Installation complete. To configure more advanced features, you can edit the JSON files in the cfg/ directory with a text editor.
-
+
-
- Happy raiding :)
-
-
-
-
+
+
diff --git a/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml
index 3336554fe..e3f26cf76 100644
--- a/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml
+++ b/tools/installer/TRX_InstallerLib/Controls/InstallSettingsStepControl.xaml
@@ -7,7 +7,7 @@
xmlns:models="clr-namespace:TRX_InstallerLib.Models"
xmlns:utils="clr-namespace:TRX_InstallerLib.Utils"
d:DataContext="{d:DesignInstance Type=models:InstallSettingsStep}"
- mc:Ignorable="d"
+ mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
@@ -20,9 +20,9 @@
-
- Step 2: Installation options
-
+
@@ -82,15 +82,10 @@
- Download music tracks
-
+
+
-
- This option lets you download compatible music files for the game
- automatically (60 MB). The legality of these files is disputable;
- the most legal way to import the music to PC is to obtain them from
- your own source - TR2 supports FLAC, OOG, MP3 and WAV files.
-
+
@@ -100,33 +95,31 @@
- Download Unfinished Business expansion pack
-
+
+
-
- The Unfinished Business expansion pack was made freeware. However, the Steam and GOG versions do not ship it. This option lets you download the expansion files automatically (6 MB).
-
+
-
-
- Import saves
+
-
- Imports existing savegame files. Only TombATI and TR1X savegame format is supported at this time.
-
+
-
- Create desktop shortcut
-
+
@@ -136,9 +129,9 @@
-
+
-
+
diff --git a/tools/installer/TRX_InstallerLib/Controls/InstallSourceControl.xaml b/tools/installer/TRX_InstallerLib/Controls/InstallSourceControl.xaml
index 843e4d23c..e0a90a658 100644
--- a/tools/installer/TRX_InstallerLib/Controls/InstallSourceControl.xaml
+++ b/tools/installer/TRX_InstallerLib/Controls/InstallSourceControl.xaml
@@ -50,8 +50,8 @@
-
-
+
+
@@ -59,9 +59,12 @@
-
+
+
- (change)
+
+
+
diff --git a/tools/installer/TRX_InstallerLib/Controls/InstallStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/InstallStepControl.xaml
index 2e43607ed..848bda727 100644
--- a/tools/installer/TRX_InstallerLib/Controls/InstallStepControl.xaml
+++ b/tools/installer/TRX_InstallerLib/Controls/InstallStepControl.xaml
@@ -24,9 +24,9 @@
-
- Step 3: Installing
-
+
diff --git a/tools/installer/TRX_InstallerLib/Controls/SourceStepControl.xaml b/tools/installer/TRX_InstallerLib/Controls/SourceStepControl.xaml
index 4da8c5eec..92dcb1a74 100644
--- a/tools/installer/TRX_InstallerLib/Controls/SourceStepControl.xaml
+++ b/tools/installer/TRX_InstallerLib/Controls/SourceStepControl.xaml
@@ -7,8 +7,8 @@
xmlns:controls="clr-namespace:TRX_InstallerLib.Controls"
xmlns:models="clr-namespace:TRX_InstallerLib.Models"
xmlns:utils="clr-namespace:TRX_InstallerLib.Utils"
- d:DataContext="{d:DesignInstance Type=models:MainWindowViewModel}"
- mc:Ignorable="d"
+ d:DataContext="{d:DesignInstance Type=models:SourceStep}"
+ mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
@@ -18,7 +18,7 @@
-
+
@@ -29,17 +29,16 @@
-
- Step 1: Choose installation source
-
+
-
- TR1X requires original game files to run.
-
- Please choose the source location where to install the data files from.
-
- If you're upgrading an existing installation, please choose TR1X.
-
+
+ Content="{Binding ViewText[command_back]}" />
+ Content="{Binding ViewText[command_next]}" />
+ Content="{Binding IsFinalStep, Converter={utils:ConditionalViewTextConverter TrueValue='command_close', FalseValue='command_cancel'}}" />
diff --git a/tools/installer/TRX_InstallerLib/Installers/InstallExecutor.cs b/tools/installer/TRX_InstallerLib/Installers/InstallExecutor.cs
index ee0dc57a7..e39f33f98 100644
--- a/tools/installer/TRX_InstallerLib/Installers/InstallExecutor.cs
+++ b/tools/installer/TRX_InstallerLib/Installers/InstallExecutor.cs
@@ -52,7 +52,7 @@ public class InstallExecutor
CreateDesktopShortcut(_settings.TargetDirectory);
}
- progress.Report(new InstallProgress { Description = "Finished", Finished = true });
+ progress.Report(new InstallProgress { Description = Language.Instance.Controls!["progress_finished"], Finished = true });
}
protected async Task CopyOriginalGameFiles(string sourceDirectory, string targetDirectory, IProgress progress)
@@ -72,11 +72,11 @@ public class InstallExecutor
{
CurrentValue = 0,
MaximumValue = 1,
- Description = "Opening embedded ZIP",
+ Description = Language.Instance.Controls!["progress_opening_zip"],
});
using var stream = AssemblyUtils.GetResourceStream("Resources.release.zip", false)
- ?? throw new ApplicationException($"Could not open embedded ZIP.");
+ ?? throw new ApplicationException(Language.Instance.Controls!["progress_zip_failure"]);
await InstallUtils.ExtractZip(stream, targetDirectory, progress, overwrite: true);
}
diff --git a/tools/installer/TRX_InstallerLib/Installers/InstallUtils.cs b/tools/installer/TRX_InstallerLib/Installers/InstallUtils.cs
index 99ef117a7..b028b3298 100644
--- a/tools/installer/TRX_InstallerLib/Installers/InstallUtils.cs
+++ b/tools/installer/TRX_InstallerLib/Installers/InstallUtils.cs
@@ -26,7 +26,7 @@ public static class InstallUtils
{
try
{
- progress.Report(new InstallProgress { Description = "Scanning directory" });
+ progress.Report(new InstallProgress { Description = Language.Instance.Controls!["progress_scanning"] });
var files = Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories);
var currentProgress = 0;
var maximumProgress = files.Length;
@@ -45,7 +45,7 @@ public static class InstallUtils
{
CurrentValue = currentProgress,
MaximumValue = maximumProgress,
- Description = $"Copying {relPath}",
+ Description = string.Format(Language.Instance.Controls!["progress_copying"], relPath),
});
Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!);
await Task.Run(() => File.Copy(sourcePath, targetPath, true));
@@ -56,7 +56,7 @@ public static class InstallUtils
{
CurrentValue = currentProgress,
MaximumValue = maximumProgress,
- Description = $"Copying {relPath} - skipped",
+ Description = string.Format(Language.Instance.Controls!["progress_skipped"], relPath),
});
}
@@ -65,7 +65,7 @@ public static class InstallUtils
}
catch (Exception e)
{
- throw new ApplicationException($"Could not extract ZIP:\n{e.Message}");
+ throw new ApplicationException(e.Message);
}
}
@@ -79,14 +79,14 @@ public static class InstallUtils
public static async Task DownloadFile(string url, IProgress progress)
{
HttpProgressClient wc = new();
- progress.Report(new InstallProgress { Description = $"Initializing download of {url}" });
+ progress.Report(new InstallProgress { Description = string.Format(Language.Instance.Controls!["progress_init_download"], url) });
wc.DownloadProgressChanged += (totalBytesToReceive, bytesReceived) =>
{
progress.Report(new InstallProgress
{
CurrentValue = (int)bytesReceived,
MaximumValue = (int)totalBytesToReceive,
- Description = $"Downloading {url}",
+ Description = string.Format(Language.Instance.Controls!["progress_downloading"], url),
});
};
return await wc.DownloadDataTaskAsync(new Uri(url));
@@ -116,7 +116,7 @@ public static class InstallUtils
using var zip = new ZipArchive(stream);
progress.Report(new InstallProgress
{
- Description = "Scanning ZIP",
+ Description = Language.Instance.Controls!["progress_scanning_zip"],
});
var currentProgress = 0;
var maximumProgress = zip.Entries.Count;
@@ -140,7 +140,7 @@ public static class InstallUtils
{
CurrentValue = currentProgress,
MaximumValue = maximumProgress,
- Description = $"Extracting {entry.FullName}",
+ Description = string.Format(Language.Instance.Controls!["progress_extracting"], entry.FullName),
});
Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!);
@@ -152,7 +152,7 @@ public static class InstallUtils
{
CurrentValue = currentProgress,
MaximumValue = maximumProgress,
- Description = $"Extracting {entry.FullName} - skipped",
+ Description = string.Format(Language.Instance.Controls!["progress_extracting_skipped"], entry.FullName),
});
}
@@ -161,7 +161,7 @@ public static class InstallUtils
}
catch (Exception e)
{
- throw new ApplicationException($"Could not extract ZIP:\n{e.Message}");
+ throw new ApplicationException(e.Message);
}
}
diff --git a/tools/installer/TRX_InstallerLib/Models/FinishStep.cs b/tools/installer/TRX_InstallerLib/Models/FinishStep.cs
index 417f1222b..aa2f31dc8 100644
--- a/tools/installer/TRX_InstallerLib/Models/FinishStep.cs
+++ b/tools/installer/TRX_InstallerLib/Models/FinishStep.cs
@@ -2,7 +2,7 @@ using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
-public class FinishStep : BaseNotifyPropertyChanged, IStep
+public class FinishStep : BaseLanguageViewModel, IStep
{
public FinishStep(FinishSettings finishSettings)
{
diff --git a/tools/installer/TRX_InstallerLib/Models/InstallSettingsStep.cs b/tools/installer/TRX_InstallerLib/Models/InstallSettingsStep.cs
index 161595ced..a9795384d 100644
--- a/tools/installer/TRX_InstallerLib/Models/InstallSettingsStep.cs
+++ b/tools/installer/TRX_InstallerLib/Models/InstallSettingsStep.cs
@@ -3,7 +3,7 @@ using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
-public class InstallSettingsStep : BaseNotifyPropertyChanged, IStep
+public class InstallSettingsStep : BaseLanguageViewModel, IStep
{
public InstallSettingsStep(InstallSettings installSettings)
{
@@ -24,7 +24,7 @@ public class InstallSettingsStep : BaseNotifyPropertyChanged, IStep
public ICommand ChooseLocationCommand
{
get => _chooseLocationCommand ??= new RelayCommand(ChooseLocation);
- }
+ }
private void ChooseLocation()
{
diff --git a/tools/installer/TRX_InstallerLib/Models/InstallSourceViewModel.cs b/tools/installer/TRX_InstallerLib/Models/InstallSourceViewModel.cs
index 992d6bff2..58115e88d 100644
--- a/tools/installer/TRX_InstallerLib/Models/InstallSourceViewModel.cs
+++ b/tools/installer/TRX_InstallerLib/Models/InstallSourceViewModel.cs
@@ -4,7 +4,7 @@ using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
-public class InstallSourceViewModel : BaseNotifyPropertyChanged
+public class InstallSourceViewModel : BaseLanguageViewModel
{
public InstallSourceViewModel(IInstallSource source)
{
@@ -38,6 +38,11 @@ public class InstallSourceViewModel : BaseNotifyPropertyChanged
}
}
+ public bool IsSourceDirectoryDefined
+ {
+ get => SourceDirectory != null;
+ }
+
public string? SourceDirectory
{
get => _sourceDirectory;
@@ -48,6 +53,7 @@ public class InstallSourceViewModel : BaseNotifyPropertyChanged
_sourceDirectory = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(IsAvailable));
+ NotifyPropertyChanged(nameof(IsSourceDirectoryDefined));
}
}
}
diff --git a/tools/installer/TRX_InstallerLib/Models/InstallStep.cs b/tools/installer/TRX_InstallerLib/Models/InstallStep.cs
index 1fcd7a56d..3ebadfbca 100644
--- a/tools/installer/TRX_InstallerLib/Models/InstallStep.cs
+++ b/tools/installer/TRX_InstallerLib/Models/InstallStep.cs
@@ -4,7 +4,7 @@ using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
-public class InstallStep : BaseNotifyPropertyChanged, IStep
+public class InstallStep : BaseLanguageViewModel, IStep
{
public InstallStep(InstallSettings installSettings)
{
diff --git a/tools/installer/TRX_InstallerLib/Models/Language.cs b/tools/installer/TRX_InstallerLib/Models/Language.cs
index d39ae2880..6b868f897 100644
--- a/tools/installer/TRX_InstallerLib/Models/Language.cs
+++ b/tools/installer/TRX_InstallerLib/Models/Language.cs
@@ -13,7 +13,7 @@ public class Language
public static Language Instance { get; private set; }
public Dictionary? Controls { get; set; }
-
+
static Language()
{
CultureInfo defaultCulture = CultureInfo.GetCultureInfo(_defaultCulture);
diff --git a/tools/installer/TRX_InstallerLib/Models/SourceStep.cs b/tools/installer/TRX_InstallerLib/Models/SourceStep.cs
index b41b313bc..e47676bb0 100644
--- a/tools/installer/TRX_InstallerLib/Models/SourceStep.cs
+++ b/tools/installer/TRX_InstallerLib/Models/SourceStep.cs
@@ -4,7 +4,7 @@ using TRX_InstallerLib.Utils;
namespace TRX_InstallerLib.Models;
-public class SourceStep : BaseNotifyPropertyChanged, IStep
+public class SourceStep : BaseLanguageViewModel, IStep
{
public SourceStep(IEnumerable installSources)
{
diff --git a/tools/installer/TRX_InstallerLib/Resources/Lang/en.json b/tools/installer/TRX_InstallerLib/Resources/Lang/en.json
index 040e6b1c9..7fa5dd695 100644
--- a/tools/installer/TRX_InstallerLib/Resources/Lang/en.json
+++ b/tools/installer/TRX_InstallerLib/Resources/Lang/en.json
@@ -1,5 +1,56 @@
{
"Controls": {
-
+ "command_back": "_Back",
+ "command_next": "_Next",
+ "command_close": "_Close",
+ "command_cancel": "_Cancel",
+ "command_change": "C_hange...",
+ "command_change_link": "(change)",
+ "label_found": "Found",
+ "label_not_found": "Not found",
+ "label_already_found": "(already found)",
+ "label_folder_not_selected": "(no folder selected)",
+ "label_destination_folder": "Destination folder:",
+ "label_select_folder": "Choose directory",
+ "step_source_heading": "Step 1: Choose installation source",
+ "step_source_content": "Placeholder",
+ "step_settings_heading": "Step 2: Installation options",
+ "step_settings_music_heading": "Download music tracks",
+ "step_settings_music_content": "Placeholder",
+ "step_settings_expansion_heading": "Placeholder",
+ "step_settings_expansion_content": "Placeholder",
+ "step_settings_expansion_music": "Placeholder",
+ "step_settings_expansion_vanilla": "Placeholder",
+ "step_settings_saves_header": "Import saves",
+ "step_settings_saves_content": "Placeholder",
+ "step_settings_shortcut_heading": "Create desktop shortcut",
+ "step_install_heading": "Step 3: Installing",
+ "step_finish_heading": "Step 4: Done",
+ "step_finish_content": "Installation complete. To configure more advanced features, you can edit the JSON files in the cfg/ directory with a text editor.\n\nHappy raiding :)",
+ "step_finish_open_directory": "Open game directory after closing this window",
+ "step_finish_open_game": "Launch the game after closing this window",
+ "progress_scanning": "Scanning directory",
+ "progress_scanning_source": "Scanning the source directory",
+ "progress_preparing_extract": "Preparing to extract the ISO",
+ "progress_copying": "Copying {0}",
+ "progress_skipped": "Copying {0} - skipped",
+ "progress_init_download": "Initializing download of {0}",
+ "progress_downloading": "Downloading {0}",
+ "progress_opening_zip": "Opening embedded ZIP",
+ "progress_zip_failure": "Could not open embedded ZIP.",
+ "progress_scanning_zip": "Scanning ZIP",
+ "progress_extracting": "Extracting {0}",
+ "progress_extracting_skipped": "Extracting {0} - skipped",
+ "progress_converting_bin": "Converting BIN to ISO",
+ "progress_converting_bin_failure": "Could not convert BIN to ISO: {0}",
+ "progress_converting_iso_failure": "Could not open converted ISO: {0}",
+ "progress_track_write_failure": "Could not write to track file {0}: {1}",
+ "progress_track_seek_failure": "Could not seek to track location: {0}",
+ "progress_bin_failure": "Could not open BIN {0}: {1}",
+ "progress_cue_failure": "Could not read CUE {0}: {1}",
+ "progress_cue_empty": "Could not parse {0}: no tracks were found",
+ "progress_finished": "Finished",
+ "shortcut_signature_failure": "Invalid LNK signature",
+ "shortcut_target_failure": "Unable to determine link target path"
}
}
diff --git a/tools/installer/TRX_InstallerLib/Resources/styles.xaml b/tools/installer/TRX_InstallerLib/Resources/styles.xaml
index d59569f5d..aad11bc51 100644
--- a/tools/installer/TRX_InstallerLib/Resources/styles.xaml
+++ b/tools/installer/TRX_InstallerLib/Resources/styles.xaml
@@ -8,6 +8,9 @@