Compare commits

...

3 Commits

6 changed files with 35 additions and 13 deletions

View File

@ -2,10 +2,10 @@ $packageArgs = @{
packageName = $env:ChocolateyPackageName packageName = $env:ChocolateyPackageName
FileType = 'exe' FileType = 'exe'
SilentArgs = '/S' SilentArgs = '/S'
Url64 = '\\ucs\software\VCarveProMakerspaceEditionV11008_Setup.exe' File64 = '\\ucs\software\VCarveProMakerspaceEditionV11015_Setup.exe'
Checksum64 = 'b6f2243d832b87c89382da7df6f309580256572d0beb88189b54bd54d56bf6f7' Checksum64 = '8f7476e8f68f00d07335ffef4369f3dce827ceb236ace1f8211137fb9542ba99'
ChecksumType64 = 'sha256' ChecksumType64 = 'sha256'
ValidExitCodes = @(0, 1223) ValidExitCodes = @(0, 1223)
} }
Install-ChocolateyPackage @packageArgs Install-ChocolateyInstallPackage @packageArgs

View File

@ -0,0 +1,21 @@
#!/bin/bash
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
file=$(ls tools/VCarveProMakerspaceEditionV110*_Setup.exe)
version=$(7z e -so $file 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 $file | 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|<version>[^<]*</version>|<version>$minor_version</version>|" "${PWD##*/}.nuspec"
sed -i "/File64/s|[^\\]*$|${file##*/}'|" tools/chocolateyInstall.ps1
sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>vcarve-pro-makerspace-11.0</id> <id>vcarve-pro-makerspace-11.0</id>
<version>0.8</version> <version>1.5</version>
<title>VCarve Pro Makerspace Edition</title> <title>VCarve Pro Makerspace Edition</title>
<authors>Vectric Ltd</authors> <authors>Vectric Ltd</authors>
<owners>Adam</owners> <owners>Adam</owners>
@ -18,6 +18,6 @@
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>
<file src="tools/**" target="tools" /> <file src="tools/*.ps1" target="tools" />
</files> </files>
</package> </package>

View File

@ -1,10 +1,8 @@
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$packageArgs = @{ $packageArgs = @{
packageName = $env:ChocolateyPackageName packageName = $env:ChocolateyPackageName
FileType = 'exe' FileType = 'exe'
SilentArgs = '/S' SilentArgs = '/S'
File64 = Join-Path $toolsDir 'VCarveProTrialEdition_Setup.exe' File64 = '\\ucs\software\VCarveProTrialEditionV11015_Setup.exe'
Checksum64 = '1088a6b21d6df5edecc7ac2a67b3866be5faf3c600c561404ebfe448a16bbc31' Checksum64 = '1088a6b21d6df5edecc7ac2a67b3866be5faf3c600c561404ebfe448a16bbc31'
ChecksumType64 = 'sha256' ChecksumType64 = 'sha256'
ValidExitCodes = @(0, 1223) ValidExitCodes = @(0, 1223)

View File

@ -4,10 +4,12 @@ cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
wget -N "https://storage.googleapis.com/vectric_public/VCarveProTrialEdition_Setup.exe" --directory-prefix tools/ 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 }') file=tools/VCarveProTrialEdition_Setup.exe
version=$(7z e -so $file ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }')
major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version) major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version)
minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version) minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version)
checksum=$(sha256sum tools/VCarveProTrialEdition_Setup.exe | awk '{print $1}') checksum=$(sha256sum $file | awk '{print $1}')
versioned_file_name="VCarveProTrialEditionV${major_version/.}${minor_version/.}_Setup.exe"
if [ "$major_version" != "11.0" ] if [ "$major_version" != "11.0" ]
then then
@ -15,7 +17,8 @@ then
exit 1 exit 1
fi fi
echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum" echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum, filename=$versioned_file_name"
sed -i "s|<version>[^<]*</version>|<version>$minor_version</version>|" vcarve-pro-trial-11.0.nuspec sed -i "s|<version>[^<]*</version>|<version>$minor_version</version>|" "${PWD##*/}.nuspec"
sed -i "/File64/s|[^\\]*$|${versioned_file_name}'|" tools/chocolateyInstall.ps1
sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1 sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1

View File

@ -18,6 +18,6 @@
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>
<file src="tools/**" target="tools" /> <file src="tools/*.ps1" target="tools" />
</files> </files>
</package> </package>