From 91678f14415f4200702a502029c31dccc1589314 Mon Sep 17 00:00:00 2001 From: dyoder Date: Sat, 7 Nov 2020 08:34:44 -0500 Subject: [PATCH] update nextcloud installer --- Install-Nextcloud.ps1 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Install-Nextcloud.ps1 b/Install-Nextcloud.ps1 index f066744..bb2ce63 100644 --- a/Install-Nextcloud.ps1 +++ b/Install-Nextcloud.ps1 @@ -1,12 +1,13 @@ -## Define URL for downloading the installer -$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/Nextcloud-3.0.3-setup.exe' -$FILE = '{0}{1}' -f (GetTempPath), (Split-Path $URL -Leaf) +. 'C:\Users\dyoder\Emberkom\Data\Projects\development\management-scripts\Tools.ps1' -$FILE = Download-File -URL $URL -File $FILE +## Define URL for downloading the installer +$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/Nextcloud-3.0.3-setup.exe' + +#$FILE = '{0}{1}' -f (GetTempPath), (Split-Path $URL -Leaf) +#$FILE = Download-File -URL $URL -File $FILE ## Stop app if it's currently running -Try { Get-Process | Where { $_.Name -like "nextcloud" } | Stop-Process -Force } -Catch { LogErr $_.Exception.Message } +End-Process -Name 'nextcloud' -Force ## Get the install location so we can start the app again after installation If ( Test-Path "HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Nextcloud" ) @@ -15,7 +16,7 @@ ElseIf ( Test-Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Nex { $InstallPath = '{0}\nextcloud.exe' -f $(Get-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Nextcloud" -ErrorAction SilentlyContinue).InstallLocation } ## Install package -Install-Program -Path $FILE -Arguments "/S" -Delete +Install-Program -Path $(Download-File -URL $URL) -Arguments "/S" -Delete ## Start the app after installation If ( Test-Path $InstallPath )