update to install 2021 version and take advantage of the Download-File function

This commit is contained in:
2021-06-23 19:42:22 -04:00
parent eee15843fb
commit 8c7cfebc11
+10 -5
View File
@@ -1,5 +1,5 @@
## Version of SketchUp to install
$InstallVersion = "2020"
$InstallVersion = "2021"
## Make sure we have an administrative token
If ( IsAdmin )
@@ -41,12 +41,17 @@ If ( IsAdmin )
Try { Start-Process "msiexec.exe" -ArgumentList '/X{5778f9a3-781e-16f1-a6bf-08fd59dfa77b} /qn /norestart' -Wait }
Catch { LogErr $_.Exception.Message }
}
## Set the local file name to download to
$FILE = '{0}{1}.exe' -f (GetTempPath),(Split-Path $URL -Leaf)
## Uninstall SketchUp 2021
If ( Test-Path "${Env:ProgramFiles}\SketchUp\SketchUp 2021\SketchUp.exe" )
{
LogMsg "Uninstalling SketchUp 2021"
Try { Start-Process "msiexec.exe" -ArgumentList '/X{e31a06f0-fc24-f59f-5b2c-941521be9626} /qn /norestart' -Wait }
Catch { LogErr $_.Exception.Message }
}
## Download installer
$FILE = Download-File -URL $URL -File $FILE
$FILE = Download-File -URL $URL
## Install package
Install-Program -Path $FILE -Arguments "/silent" -Delete