feat: add paranoid check

This commit is contained in:
itsscb 2025-04-16 13:29:13 +02:00
parent 1574cc38bb
commit 20d037b1e8

View File

@ -124,6 +124,7 @@ begin
"recaptcha": null "recaptcha": null
} }
}' }'
$app_dir = Join-Path $env:PROGRAMDATA 'filebrowser' $app_dir = Join-Path $env:PROGRAMDATA 'filebrowser'
if(-not (Test-Path $app_dir -PathType Container)) if(-not (Test-Path $app_dir -PathType Container))
{ {
@ -142,12 +143,14 @@ begin
} }
} }
if(-not (Test-Path $filebrowser_exe -PathType Leaf))
{
throw "filebrowser.exe is missing"
}
Set-Alias 'filebrowser' $filebrowser_exe Set-Alias 'filebrowser' $filebrowser_exe
$config_path = Join-Path $app_dir 'config.json' $config_path = Join-Path $app_dir 'config.json'
# if(-not (Test-Path $config_path -PathType Leaf))
# {
$config_json > $config_path $config_json > $config_path
# }
$db_path = Join-Path $app_dir "filebrowser.db" $db_path = Join-Path $app_dir "filebrowser.db"
if(Test-Path $db_path -PathType Leaf) if(Test-Path $db_path -PathType Leaf)