2023-01-13 08:34:55 -05:00
|
|
|
# $InstallVersion must be set by the calling script or specified here
|
|
|
|
|
|
|
|
|
|
# Make sure we have an administrative token
|
2020-10-22 14:01:35 -04:00
|
|
|
If ( IsAdmin )
|
2020-08-30 23:05:07 -04:00
|
|
|
{
|
2023-01-13 08:34:55 -05:00
|
|
|
# Define URL for downloading the installer
|
2020-10-22 14:01:35 -04:00
|
|
|
$URL = "https://www.sketchup.com/sketchup/${InstallVersion}/SketchUpPro-exe"
|
|
|
|
|
|
2023-01-13 08:34:55 -05:00
|
|
|
# Make sure the URL is valid before we do anything
|
2020-10-22 14:01:35 -04:00
|
|
|
If ( IsURLValid $URL )
|
|
|
|
|
{
|
2023-01-18 19:32:05 -05:00
|
|
|
# TODO: Uninstall all versions of SketchUp
|
|
|
|
|
#$APP_NAME = "SketchUp*"
|
|
|
|
|
#Run-Script -LivePSScript Uninstall-MSI
|
2022-09-21 20:30:40 -04:00
|
|
|
|
2023-01-13 08:34:55 -05:00
|
|
|
# Set the local file name to download to
|
2021-06-24 11:48:04 -04:00
|
|
|
$FILE = '{0}{1}.exe' -f (GetTempPath),(Split-Path $URL -Leaf)
|
|
|
|
|
|
2023-01-13 08:34:55 -05:00
|
|
|
# Download installer
|
2021-06-24 11:48:04 -04:00
|
|
|
$FILE = Download-File -URL $URL -File $FILE
|
2020-10-22 14:01:35 -04:00
|
|
|
|
2023-01-13 08:34:55 -05:00
|
|
|
# Install package
|
2020-10-22 14:01:35 -04:00
|
|
|
Install-Program -Path $FILE -Arguments "/silent" -Delete
|
|
|
|
|
}
|
2020-08-30 23:05:07 -04:00
|
|
|
}
|