0
0
mirror of https://github.com/sp-tarkov/installer.git synced 2025-02-12 14:50:45 -05:00

update path validation

This commit is contained in:
IsWaffle 2024-12-04 18:08:35 -05:00
parent b3c5063050
commit b936011d2a
2 changed files with 5 additions and 5 deletions

View File

@ -10,8 +10,8 @@
<PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.93</AssemblyVersion>
<FileVersion>2.93</FileVersion>
<AssemblyVersion>2.94</AssemblyVersion>
<FileVersion>2.94</FileVersion>
<Company>SPT</Company>
</PropertyGroup>

View File

@ -87,17 +87,17 @@ public class InstallPathSelectionViewModel : ViewModelBase
public void ValidatePath()
{
if (String.IsNullOrEmpty(SelectedPath))
if (String.IsNullOrEmpty(SelectedPath) || SelectedPath.Length < 4)
{
ErrorMessage = "Please provide an install path";
ValidPath = false;
return;
}
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|]");
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|!@#$%^&*+=,[\]{}`~;']|\\\\");
if (match.Success)
{
ErrorMessage = "Path cannot contain these characters: / : * ? \" < > |";
ErrorMessage = "Path cannot contain symbols other than ( ) \\ - _ .";
ValidPath = false;
return;
}