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:
parent
b3c5063050
commit
b936011d2a
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user