From d2bfb17ab19587f44f1884efe75a90a7c0bf61dc Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 20 Jul 2022 00:03:16 -0400 Subject: [PATCH] vcarve-pro-trial-11.0: Internalize, bump to 1.5, add update script --- .gitignore | 4 ++++ .../tools/chocolateyInstall.ps1 | 8 ++++--- vcarve-pro-trial-11.0/update.sh | 21 +++++++++++++++++++ .../vcarve-pro-trial-11.0.nuspec | 2 +- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100755 vcarve-pro-trial-11.0/update.sh diff --git a/.gitignore b/.gitignore index a1e3e4d..d19034f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ # Built packages *.nupkg + +# Installers +/*/tools/*.exe +/*/tools/*.msi diff --git a/vcarve-pro-trial-11.0/tools/chocolateyInstall.ps1 b/vcarve-pro-trial-11.0/tools/chocolateyInstall.ps1 index 68a2bda..3347782 100644 --- a/vcarve-pro-trial-11.0/tools/chocolateyInstall.ps1 +++ b/vcarve-pro-trial-11.0/tools/chocolateyInstall.ps1 @@ -1,11 +1,13 @@ +$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition + $packageArgs = @{ packageName = $env:ChocolateyPackageName FileType = 'exe' SilentArgs = '/S' - Url64 = '\\ucs\software\VCarveProTrialEditionV11008_Setup.exe' - Checksum64 = 'ee90e3be12712cb799ee51cb7e0f8e2e0b723dfc4d97ced0f88f187d0dd22f04' + File64 = Join-Path $toolsDir 'VCarveProTrialEdition_Setup.exe' + Checksum64 = '1088a6b21d6df5edecc7ac2a67b3866be5faf3c600c561404ebfe448a16bbc31' ChecksumType64 = 'sha256' ValidExitCodes = @(0, 1223) } -Install-ChocolateyPackage @packageArgs +Install-ChocolateyInstallPackage @packageArgs diff --git a/vcarve-pro-trial-11.0/update.sh b/vcarve-pro-trial-11.0/update.sh new file mode 100755 index 0000000..49aa1f2 --- /dev/null +++ b/vcarve-pro-trial-11.0/update.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" + +wget -N "https://storage.googleapis.com/vectric_public/VCarveProTrialEdition_Setup.exe" --directory-prefix tools/ + +version=$(7z e -so tools/VCarveProTrialEdition_Setup.exe ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }') +major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version) +minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version) +checksum=$(sha256sum tools/VCarveProTrialEdition_Setup.exe | awk '{print $1}') + +if [ "$major_version" != "11.0" ] +then + echo "Major version update! This probably won't really work well." + exit 1 +fi + +echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum" + +sed -i "s|[^<]*|$minor_version|" vcarve-pro-trial-11.0.nuspec +sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1 diff --git a/vcarve-pro-trial-11.0/vcarve-pro-trial-11.0.nuspec b/vcarve-pro-trial-11.0/vcarve-pro-trial-11.0.nuspec index af51a55..836f75b 100644 --- a/vcarve-pro-trial-11.0/vcarve-pro-trial-11.0.nuspec +++ b/vcarve-pro-trial-11.0/vcarve-pro-trial-11.0.nuspec @@ -2,7 +2,7 @@ vcarve-pro-trial-11.0 - 0.8 + 1.5 VCarve Pro Trial Vectric Ltd Adam