update to install 2021 version and take advantage of the Download-File function
This commit is contained in:
+10
-5
@@ -1,5 +1,5 @@
|
|||||||
## Version of SketchUp to install
|
## Version of SketchUp to install
|
||||||
$InstallVersion = "2020"
|
$InstallVersion = "2021"
|
||||||
|
|
||||||
## Make sure we have an administrative token
|
## Make sure we have an administrative token
|
||||||
If ( IsAdmin )
|
If ( IsAdmin )
|
||||||
@@ -41,12 +41,17 @@ If ( IsAdmin )
|
|||||||
Try { Start-Process "msiexec.exe" -ArgumentList '/X{5778f9a3-781e-16f1-a6bf-08fd59dfa77b} /qn /norestart' -Wait }
|
Try { Start-Process "msiexec.exe" -ArgumentList '/X{5778f9a3-781e-16f1-a6bf-08fd59dfa77b} /qn /norestart' -Wait }
|
||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
}
|
}
|
||||||
|
|
||||||
## Set the local file name to download to
|
## Uninstall SketchUp 2021
|
||||||
$FILE = '{0}{1}.exe' -f (GetTempPath),(Split-Path $URL -Leaf)
|
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
|
## Download installer
|
||||||
$FILE = Download-File -URL $URL -File $FILE
|
$FILE = Download-File -URL $URL
|
||||||
|
|
||||||
## Install package
|
## Install package
|
||||||
Install-Program -Path $FILE -Arguments "/silent" -Delete
|
Install-Program -Path $FILE -Arguments "/silent" -Delete
|
||||||
|
|||||||
Reference in New Issue
Block a user