fix: don't remove SVR.JS zip archive when installed manually
This commit is contained in:
parent
400eef1692
commit
e1359e25b4
1 changed files with 5 additions and 1 deletions
|
@ -61,7 +61,9 @@ if (!(Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs")) {
|
|||
}
|
||||
|
||||
# Download SVR.JS zip archive
|
||||
$manuallyInstalled = $False
|
||||
if ($installType -eq "manual") {
|
||||
$manuallyInstalled = $True
|
||||
$svrjsZipArchive = Read-Host "Path to SVR.JS zip archive"
|
||||
} elseif ($INSTALLTYPE -eq "stable") {
|
||||
$svrjsVersion = (Invoke-RestMethod -Uri "https://downloads.svrjs.org/latest.svrjs").Trim()
|
||||
|
@ -127,7 +129,9 @@ Remove-Item -Path $nodejsZipArchive
|
|||
# Extract SVR.JS files
|
||||
Write-Host "Extracting SVR.JS files..."
|
||||
Expand-Archive -Path $svrjsZipArchive -DestinationPath "$env:SYSTEMDRIVE\svrjs\svrjs" -Force
|
||||
Remove-Item -Path $svrjsZipArchive
|
||||
if (!($manuallyInstalled)) {
|
||||
Remove-Item -Path $svrjsZipArchive
|
||||
}
|
||||
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs\svr.compressed" -PathType "Leaf") {
|
||||
Push-Location
|
||||
Set-Location -Path "$env:SYSTEMDRIVE\svrjs\svrjs"
|
||||
|
|
Loading…
Reference in a new issue