From 12a7142511b6e1d0b757e5e5eabf2253db96ca47 Mon Sep 17 00:00:00 2001 From: Kevin Woley Date: Sat, 8 Feb 2020 14:45:01 -0800 Subject: [PATCH] add retic.exe download to install script --- .gitignore | 3 ++- config.ps1 | 3 ++- install.ps1 | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 17c39e8..c4df3d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ local.exclude logs restic.exe -secrets.ps1 \ No newline at end of file +secrets.ps1 +state.xml \ No newline at end of file diff --git a/config.ps1 b/config.ps1 index 6dc36f1..6911e74 100644 --- a/config.ps1 +++ b/config.ps1 @@ -1,6 +1,7 @@ # backup configuration +$ExeName = "restic.exe" $InstallPath = "C:\restic" -$ResticExe = Join-Path $InstallPath "restic.exe" +$ResticExe = Join-Path $InstallPath $ExeName $StateFile = Join-Path $InstallPath "state.xml" $WindowsExcludeFile = Join-Path $InstallPath "windows.exclude" $LocalExcludeFile = Join-Path $InstallPath "local.exclude" diff --git a/install.ps1 b/install.ps1 index 5cc1c0a..05c97ca 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1,5 +1,15 @@ . .\config.ps1 +# download restic +if(-not (Test-Path $ResticExe)) { + $url = "https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_windows_amd64.zip" + $output = Join-Path $InstallPath "restic.zip" + Invoke-WebRequest -Uri $url -OutFile $output + Expand-Archive -LiteralPath $output $InstallPath + Remove-Item $output + Get-ChildItem *.exe | Rename-Item -NewName $ExeName +} + # Create log directory if it doesn't exit if(-not (Test-Path $LogPath)) {