From f999900e3a1cf54b57fe051f248dae56f31f8b7c Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 26 Aug 2023 00:27:18 -0400 Subject: update version, add script for updating windows installer --- control | 2 +- development.md | 2 +- ted.h | 2 +- update-windows-installer.py | 42 ++++++++++++++++++++++++++++++++++++++++ windows_installer/ted/ted.vdproj | 6 +++--- 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 update-windows-installer.py diff --git a/control b/control index 4c84524..386a638 100644 --- a/control +++ b/control @@ -1,5 +1,5 @@ Package: ted -Version: 2.5 +Version: 2.5.1 Section: text Priority: optional Architecture: amd64 diff --git a/development.md b/development.md index 086b46a..205c843 100644 --- a/development.md +++ b/development.md @@ -120,6 +120,6 @@ When releasing a new version of `ted`: - Update `Version` in `control` for the `.deb` file. - Run `make ted.deb` on Debian/Ubuntu. - Run `make.bat release` on Windows. -- Open installer project, and increase version number. +- Run `python update-windows-installer.py`. - Build `ted.msi`. - Create a new release on GitHub with `ted.deb` and `ted.msi`. diff --git a/ted.h b/ted.h index 1d41e49..77f556b 100644 --- a/ted.h +++ b/ted.h @@ -22,7 +22,7 @@ extern "C" { #include "command.h" /// Version number -#define TED_VERSION "2.5" +#define TED_VERSION "2.5.1" /// Maximum path size ted handles. #define TED_PATH_MAX 1024 /// Config filename diff --git a/update-windows-installer.py b/update-windows-installer.py new file mode 100644 index 0000000..eb272a3 --- /dev/null +++ b/update-windows-installer.py @@ -0,0 +1,42 @@ +# update windows installer ProductVersion/ProductCode/PackageCode +# this needs to be done for every release of ted + +import uuid +import re +from datetime import datetime + +timestamp = datetime.utcnow() +# will break in 2100. FUCK YOU PEOPEL OF THE FUTURE!! +version_start = '%02d.%02d.%02d' % (timestamp.year % 100, timestamp.month, timestamp.day) +product_code = str(uuid.uuid4()).upper() +package_code = str(uuid.uuid4()).upper() + +PATH = 'windows_installer/ted/ted.vdproj' + +f = open(PATH) +text = f.read() +f.close() + +text = re.sub(r'"ProductCode" = "8:\{.*\}"', '"ProductCode" = "8:{%s}"' % product_code, text) +text = re.sub(r'"PackageCode" = "8:\{.*\}"', '"PackageCode" = "8:{%s}"' % package_code, text) +curr_version = re.search('"ProductVersion" = "8:([^"]*)"', text).group(1) +curr_version_start = curr_version[:len(version_start)] +daily_id = 0 +if curr_version_start > version_start: + print('time went backwards. aborting.') + exit(1) +elif curr_version_start == version_start: + daily_id = int(curr_version[len(version_start):]) + 1 + if daily_id >= 100: + + print('''you've updated the windows installer 100 times today. +i think you should take a break. +aborting. +''') + exit(1) + +version = '%s%02d' % (version_start, daily_id) +text = re.sub(r'"ProductVersion" = "8:([^"]*)"', r'"ProductVersion" = "8:%s"' % version, text) +f = open(PATH, 'w') +f.write(text) +f.close() diff --git a/windows_installer/ted/ted.vdproj b/windows_installer/ted/ted.vdproj index a65a539..91afebf 100644 --- a/windows_installer/ted/ted.vdproj +++ b/windows_installer/ted/ted.vdproj @@ -620,15 +620,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:ted" - "ProductCode" = "8:{51C543F8-F64F-4D57-ADAF-B7FF69EA8D1D}" - "PackageCode" = "8:{2553F30D-B299-4352-8C82-61883B4BE646}" + "ProductCode" = "8:{D45DA042-74C5-4BC5-8B7B-018B58C2DDB1}" + "PackageCode" = "8:{2488749C-919C-497F-A65A-D3ED805AC5B5}" "UpgradeCode" = "8:{844F6C2B-DF3B-4A81-9BD5-603401BBA651}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:FALSE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:23.08.1517" + "ProductVersion" = "8:23.08.2601" "Manufacturer" = "8:ted" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" -- cgit v1.2.3