Skip to content

Commit

Permalink
update version, add script for updating windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
pommicket committed Aug 26, 2023
1 parent 7497aa7 commit f999900
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: ted
Version: 2.5
Version: 2.5.1
Section: text
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
2 changes: 1 addition & 1 deletion ted.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions update-windows-installer.py
Original file line number Diff line number Diff line change
@@ -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()
6 changes: 3 additions & 3 deletions windows_installer/ted/ted.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit f999900

Please sign in to comment.