diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3b488da..adbcb92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,10 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.7.1] - 2021-04-01
+### Added
+- Add Update.ps1 to automatically download the latest version from Github for Windows users.
+
## [1.7.0] - 2021-04-01
### Added
- Add automatic retry functionality for downloads. It will retry downloading a file after an error 3 times.
-- Add Update.ps1 to automatically download the latest version from Github for Windows users.
### Changed
- Fixed an issue downloads sometimes getting added multiple times.
diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html
index b0e65d2..d0ce683 100644
--- a/client/src/app/navbar/navbar.component.html
+++ b/client/src/app/navbar/navbar.component.html
@@ -49,7 +49,7 @@
Profile
Logout
- Version 1.7.0
+ Version 1.7.1
diff --git a/package.json b/package.json
index 7f4ede0..d2a13db 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rdt-client",
- "version": "1.7.0",
+ "version": "1.7.1",
"description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js",
"dependencies": {
diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj
index ba14847..d6beecd 100644
--- a/server/RdtClient.Web/RdtClient.Web.csproj
+++ b/server/RdtClient.Web/RdtClient.Web.csproj
@@ -4,7 +4,7 @@
net5.0
Exe
94c24cba-f03f-4453-a671-3640b517c573
- 1.7.0
+ 1.7.1
diff --git a/server/RdtClient.Web/Update.ps1 b/server/RdtClient.Web/Update.ps1
index de581d2..69c5abe 100644
--- a/server/RdtClient.Web/Update.ps1
+++ b/server/RdtClient.Web/Update.ps1
@@ -1,26 +1,51 @@
-If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
+$currentDirectory = $PSScriptRoot
+
+Write-Host "Starting update script in $currentDirectory"
+
+If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
+Write-Host "Stopping ReadDebridClient..."
+
Stop-Service RealDebridClient
+Write-Host "Stopped ReadDebridClient"
+
$releasesUri = "https://api.github.com/repos/rogerfar/rdt-client/releases/latest"
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like "*.zip").browser_download_url
+Write-Host "Downloading $downloadUri"
+
$pathZip = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $(Split-Path -Path $downloadUri -Leaf)
Invoke-WebRequest -Uri $downloadUri -Out $pathZip
$tempExtract = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $((New-Guid).Guid)
+Write-Host "Extracting to $tempExtract"
+
Expand-Archive -Path $pathZip -DestinationPath $tempExtract -Force
-Copy-Item -Path ".\appsettings.json" -Destination $tempExtract -Force
-Move-Item -Path "$tempExtract\*" -Destination $pathExtract -Force
+
+Write-Host "Backing up appsettings.json"
+
+Copy-Item -Path "$currentDirectory\appsettings.json" -Destination $tempExtract -Force
+
+Write-Host "Moving new files"
+
+Move-Item -Path "$tempExtract\*" -Destination $currentDirectory -Force
+
+Write-Host "Removing temp files"
+
Remove-Item -Path $tempExtract -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item $pathZip -Force
-Start-Service RealDebridClient
\ No newline at end of file
+Write-Host "Starting ReadDebridClient..."
+
+Start-Service RealDebridClient
+
+Write-Host "Started ReadDebridClient"
\ No newline at end of file