version lock installer

version 2023.1.340.117
This commit is contained in:
2023-10-13 10:55:09 -04:00
parent f46446ae37
commit a97150d45a
+15 -19
View File
@@ -1,24 +1,20 @@
# $InstallVersion must be set by the calling script or specified here
# Make sure we have an administrative token # This is the URL for retreving the latest version of the specified installer
If ( IsAdmin ) # Trying to query this URL directly no longer works now that CloudFlare is blocking script access
{ # It does, however, work in the browser to retrieve the direct download link
# Define URL for downloading the installer # https://www.sketchup.com/sketchup/2023/SketchUpPro-exe
$URL = "https://www.sketchup.com/sketchup/${InstallVersion}/SketchUpPro-exe"
# Make sure the URL is valid before we do anything # Define URL for downloading the installer
If ( IsURLValid $URL ) $URL = 'https://download.sketchup.com/SketchUpStudio-2023-1-340-117.exe'
{
# 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 # TODO: Uninstall all versions of SketchUp
$FILE = '{0}{1}.exe' -f (Get-TempPath),(Split-Path $URL -Leaf) #'SketchUp 2019', 'SketchUp 2021', 'SketchUp 2022', 'SketchUp 2023', 'SketchUp Viewer' | Uninstall-MSI
# Download installer # Set the local file name to download to
$FILE = Download-File -URL $URL -File $FILE $FILE = '{0}{1}' -f (Get-TempPath),(Split-Path $URL -Leaf)
# Install package # Download installer
Install-Program -Path $FILE -Arguments "/silent" -Delete $FILE = Download-File -URL $URL -File $FILE
}
} # Install package
Install-Program -Path $FILE -Arguments "/silent" -Delete