0
0
mirror of https://github.com/sp-tarkov/installer.git synced 2025-02-13 01:30:47 -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> <PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon> <ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations> <Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.93</AssemblyVersion> <AssemblyVersion>2.94</AssemblyVersion>
<FileVersion>2.93</FileVersion> <FileVersion>2.94</FileVersion>
<Company>SPT</Company> <Company>SPT</Company>
</PropertyGroup> </PropertyGroup>

View File

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