Skip to content

Commit

Permalink
updating rhino update script
Browse files Browse the repository at this point in the history
  • Loading branch information
andyopayne committed Nov 2, 2023
1 parent 55b5573 commit 0f9d36a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions script/production/module_update_rhino.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Set-ExecutionPolicy Bypass -Scope Process -Force

param (
[Parameter(Mandatory=$true)][string] $EmailAddress
)
Expand Down Expand Up @@ -29,16 +31,13 @@ Write-Host @"

try {
Write-Step 'Checking for update'

$rhino7DownloadUrl = "https://www.rhino3d.com/download/rhino-for-windows/7/latest/direct?email=$EmailAddress"
$rhino7DownloadUrl = "https://www.rhino3d.com/download/rhino-for-windows/7/latest/direct/?email=$emailAddress"
if ((Get-Host).Version.Major -gt 5) {
$uri = (Invoke-WebRequest -Method 'GET' -MaximumRedirection 0 -Uri $rhino7DownloadUrl -ErrorAction Ignore -SkipHttpErrorCheck).Headers.Location
} else {
$uri = (Invoke-WebRequest -Method 'GET' -MaximumRedirection 0 -Uri $rhino7DownloadUrl -ErrorAction Ignore).Headers.Location
}
$packageName = [System.IO.Path]::GetFileName($uri)
$packageVersion = [Version][System.IO.Path]::GetFileNameWithoutExtension($uri).split('_')[-1]

$installedVersion = [Version] (get-itemproperty -Path HKLM:\SOFTWARE\McNeel\Rhinoceros\7.0\Install -name "version").Version

if ($installedVersion -ge $packageVersion) {
Expand Down

0 comments on commit 0f9d36a

Please sign in to comment.