Compare commits
2 Commits
6502dde280
...
498eeaa0ef
Author | SHA1 | Date | |
---|---|---|---|
498eeaa0ef | |||
e751f937a2 |
@ -5,16 +5,18 @@
|
|||||||
|
|
||||||
Clear-Host
|
Clear-Host
|
||||||
|
|
||||||
Write-Host "Stopping installer ..."
|
Write-Host "Stopping installer ... " -ForegroundColor cyan -NoNewLine
|
||||||
|
|
||||||
$installer = Stop-Process -Name "SPTInstaller" -ErrorAction SilentlyContinue
|
$installer = Stop-Process -Name "SPTInstaller" -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
if ($installer -ne $null)
|
if ($installer -ne $null)
|
||||||
{
|
{
|
||||||
Write-Host "Something went wrong, couldn't stop installer process'"
|
Write-Warning "Something went wrong, couldn't stop installer process'"
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "OK" -ForegroundColor green
|
||||||
|
|
||||||
if (-not(Test-Path $source) -and -not(Test-Path $destination)) {
|
if (-not(Test-Path $source) -and -not(Test-Path $destination)) {
|
||||||
Write-Warning "Can't find a required file"
|
Write-Warning "Can't find a required file"
|
||||||
Write-host ""
|
Write-host ""
|
||||||
@ -23,7 +25,7 @@ if (-not(Test-Path $source) -and -not(Test-Path $destination)) {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Copying new installer ..."
|
Write-Host "Copying new installer ... " -ForegroundColor cyan
|
||||||
|
|
||||||
$maxAttempts = 10
|
$maxAttempts = 10
|
||||||
$copied = $false
|
$copied = $false
|
||||||
@ -32,7 +34,7 @@ while (-not $copied) {
|
|||||||
|
|
||||||
$maxAttempts--
|
$maxAttempts--
|
||||||
|
|
||||||
Write-Host "Please wait ..."
|
Write-Host " > Please wait ... " -NoNewLine
|
||||||
|
|
||||||
if ($maxAttempts -le 0) {
|
if ($maxAttempts -le 0) {
|
||||||
Write-Host "Couldn't copy new installer :( Please re-download the installer"
|
Write-Host "Couldn't copy new installer :( Please re-download the installer"
|
||||||
@ -42,8 +44,15 @@ while (-not $copied) {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
Remove-Item $destination -ErrorAction SilentlyContinue
|
Remove-Item $destination -ErrorAction SilentlyContinue
|
||||||
Copy-Item $source $destination -ErrorAction SilentlyContinue
|
Copy-Item $source $destination -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Host "file locked, retrying ..." -ForegroundColor yellow
|
||||||
|
sleep(2)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if (Test-Path $destination) {
|
if (Test-Path $destination) {
|
||||||
$sLength = (Get-Item $source).Length
|
$sLength = (Get-Item $source).Length
|
||||||
@ -51,9 +60,11 @@ while (-not $copied) {
|
|||||||
|
|
||||||
if ($sLength -eq $dLength) {
|
if ($sLength -eq $dLength) {
|
||||||
$copied = $true
|
$copied = $true
|
||||||
|
Write-Host "OK" -ForegroundColor green
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "sizes differ, retrying ..." -ForegroundColor yellow
|
||||||
sleep(2)
|
sleep(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.84</AssemblyVersion>
|
<AssemblyVersion>2.85</AssemblyVersion>
|
||||||
<FileVersion>2.84</FileVersion>
|
<FileVersion>2.85</FileVersion>
|
||||||
<Company>SPT</Company>
|
<Company>SPT</Company>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user