mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-04-19 19:15:28 +00:00
Merge pull request #11 from AShifter/master
Check input/output file names and input server URL
This commit is contained in:
commit
4c0f87ec78
1 changed files with 12 additions and 1 deletions
|
@ -10,7 +10,6 @@ namespace LBPUnion.UnionPatcher.Gui {
|
|||
private readonly FilePicker filePicker;
|
||||
private readonly TextBox serverUrl;
|
||||
private readonly FilePicker outputFileName;
|
||||
|
||||
public Dialog CreateOkDialog(string title, string errorMessage) {
|
||||
DynamicLayout layout = new();
|
||||
Button button;
|
||||
|
@ -86,6 +85,18 @@ namespace LBPUnion.UnionPatcher.Gui {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.filePicker.FilePath == this.outputFileName.FilePath)
|
||||
{
|
||||
this.CreateOkDialog("Form Error", "Input and output filename are the same! Please save the patched file with a different name so you have a backup of your the original EBOOT.ELF.").ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Uri.TryCreate(this.serverUrl.Text, UriKind.Absolute, out _))
|
||||
{
|
||||
this.CreateOkDialog("Form Error", "Server URL is invalid! Please enter a valid URL.").ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Patcher.PatchFile(this.filePicker.FilePath, this.serverUrl.Text, this.outputFileName.FilePath);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue