25 lines
819 B
PowerShell
25 lines
819 B
PowerShell
# $InstallVersion must be set by the calling script or specified here
|
|
|
|
# Make sure we have an administrative token
|
|
If ( IsAdmin )
|
|
{
|
|
# Define URL for downloading the installer
|
|
$URL = "https://www.sketchup.com/sketchup/${InstallVersion}/SketchUpPro-exe"
|
|
|
|
# Make sure the URL is valid before we do anything
|
|
If ( IsURLValid $URL )
|
|
{
|
|
# TODO: Uninstall all versions of SketchUp
|
|
# 'SketchUp 2019', 'SketchUp 2021', 'SketchUp 2022', 'SketchUp 2023', 'SketchUp Viewer' | Uninstall-MSI
|
|
|
|
# Set the local file name to download to
|
|
$FILE = '{0}{1}.exe' -f (Get-TempPath),(Split-Path $URL -Leaf)
|
|
|
|
# Download installer
|
|
$FILE = Download-File -URL $URL -File $FILE
|
|
|
|
# Install package
|
|
Install-Program -Path $FILE -Arguments "/silent" -Delete
|
|
}
|
|
}
|