2022-07-20 00:03:16 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
|
|
|
|
|
|
|
wget -N "https://storage.googleapis.com/vectric_public/VCarveProTrialEdition_Setup.exe" --directory-prefix tools/
|
|
|
|
|
2022-07-20 15:07:37 -04:00
|
|
|
file=tools/VCarveProTrialEdition_Setup.exe
|
|
|
|
version=$(7z e -so $file ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }')
|
2022-07-20 00:03:16 -04:00
|
|
|
major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version)
|
|
|
|
minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version)
|
2022-07-20 15:07:37 -04:00
|
|
|
checksum=$(sha256sum $file | awk '{print $1}')
|
2022-07-31 16:48:40 -04:00
|
|
|
versioned_file_name="VCarveProTrialEditionV${major_version/.}${minor_version/.}_Setup.exe"
|
2022-07-20 00:03:16 -04:00
|
|
|
|
|
|
|
if [ "$major_version" != "11.0" ]
|
|
|
|
then
|
|
|
|
echo "Major version update! This probably won't really work well."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-07-31 16:48:40 -04:00
|
|
|
echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum, filename=$versioned_file_name"
|
2022-07-20 00:03:16 -04:00
|
|
|
|
2022-07-20 15:07:37 -04:00
|
|
|
sed -i "s|<version>[^<]*</version>|<version>$minor_version</version>|" "${PWD##*/}.nuspec"
|
2022-07-31 16:48:40 -04:00
|
|
|
sed -i "/File64/s|[^\\]*$|${versioned_file_name}'|" tools/chocolateyInstall.ps1
|
2022-07-20 00:03:16 -04:00
|
|
|
sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1
|