Skip to content

Commit

Permalink
updating rhino 7 bootstrap scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andyopayne committed Nov 8, 2023
1 parent a564ad7 commit b24c012
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
Binary file modified script/production/bootstrap_step-1.zip
Binary file not shown.
13 changes: 9 additions & 4 deletions script/production/bootstrap_step-1/module_rhino.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ SetEnvVar 'RHINO_COMPUTE_URLS' 'http://+:80'

# Download and install Rhino
Write-Step 'Download latest Rhino 7'
$rhino7DownloadUrl = "https://www.rhino3d.com/download/rhino-for-windows/7/latest/direct?email=$EmailAddress"
$rhino7DownloadUrl = "https://www.rhino3d.com/www-api/download/direct/?slug=rhino-for-windows/7/latest/direct?email=$EmailAddress"
$rhino7Setup = "rhino7_setup.exe"
Download $rhino7DownloadUrl $rhino7Setup
# TODO: print rhino version

# Set firewall rule to allow installation
New-NetFirewallRule -DisplayName "Rhino 7 Installer" -Direction Inbound -Program $rhino7Setup -Action Allow

Write-Step 'Installing Rhino'
# automated install (https://wiki.mcneel.com/rhino/installingrhino/6)
# automated install (https://wiki.mcneel.com/rhino/installingrhino/7)
Start-Process -FilePath $rhino7Setup -ArgumentList '-passive', '-norestart' -Wait
# delete installer
Remove-Item $rhino7Setup
Remove-Item $rhino7Setup
# Print installed version number
$installedVersion = [Version] (get-itemproperty -Path HKLM:\SOFTWARE\McNeel\Rhinoceros\7.0\Install -name "version").Version
Write-Step "Successfully installed $installedVersion"
Binary file modified script/production/bootstrap_step-2.zip
Binary file not shown.
31 changes: 23 additions & 8 deletions script/production/module_update_compute.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,34 @@ $giturl = "$gitPrefix/$actionurl"

$response = Invoke-RestMethod -Method Get -Uri $giturl
$artifacts = $response.artifacts
$latest = $artifacts[0]
$artifactID = $latest.id
$artifactID = -1
$matchingBranch = "7.x"

for($i=0; $i -lt $artifacts.Length; $i++){
$latest = $artifacts[$i]
$artifactID = $latest.id
$artifactBranch = $latest.workflow_run.head_branch
if ($artifactBranch -eq $matchingBranch) {
break
}
}

if ($artifactID -lt 0){
Write-Host "Unable to find the latest $matchingBranch build artifact." -ForegroundColor Red
exit 1
}

$downloadurl = "$nightlyPrefix/$actionurl/$artifactID.zip"

if (-Not (Test-Path -Path $physicalPathRoot)){
New-Item $physicalPathRoot -ItemType Directory
if (-Not (Test-Path -Path $appDirectory)){
New-Item $appDirectory -ItemType Directory
}

if ((Test-Path -Path $physicalPathRoot)) {
if ((Test-Path $appDirectory)) {
Write-Step "Download and unzip latest build of compute from $downloadurl"
Download $downloadurl "$physicalPathRoot/compute.zip"
Expand-Archive "$physicalPathRoot/compute.zip" -DestinationPath $physicalPathRoot
Remove-Item "$physicalPathRoot/compute.zip"
Download $downloadurl "$appDirectory/compute.zip"
Expand-Archive "$appDirectory/compute.zip" -DestinationPath $appDirectory
Remove-Item "$appDirectory/compute.zip"
}

Write-Step "Starting the IIS Service"
Expand Down
9 changes: 7 additions & 2 deletions script/production/module_update_rhino.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ try {
Write-Step 'Download latest Rhino 7'
$rhino7Setup = "rhino7_setup.exe"
Download $rhino7DownloadUrl $rhino7Setup
# TODO: print rhino version

# Set firewall rule to allow installation
New-NetFirewallRule -DisplayName "Rhino 7 Installer" -Direction Inbound -Program $rhino7Setup -Action Allow

Write-Step 'Installing Rhino'
# automated install (https://wiki.mcneel.com/rhino/installingrhino/6)
# automated install (https://wiki.mcneel.com/rhino/installingrhino/7)
Start-Process -FilePath $rhino7Setup -ArgumentList '-passive', '-norestart' -Wait
# delete installer
Remove-Item $rhino7Setup
# Print installed version number
$installedVersion = [Version] (get-itemproperty -Path HKLM:\SOFTWARE\McNeel\Rhinoceros\7.0\Install -name "version").Version
Write-Step "Successfully installed $installedVersion"
}finally {}

0 comments on commit b24c012

Please sign in to comment.