From 181607d89ea5b0971786ae724027e072d53d14ca Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Sun, 15 Dec 2024 02:49:54 +0100 Subject: [PATCH] [windows] adjust set-client-version.py file to update boinc.json file Signed-off-by: Vitalii Koshura --- set-client-version.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/set-client-version.py b/set-client-version.py index e2284dc0397..48a124cbe56 100644 --- a/set-client-version.py +++ b/set-client-version.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with BOINC. If not, see . +import json import os import subprocess import sys @@ -87,15 +88,15 @@ def set_build_gradle(version): line = f' def version = \'{version} : DEVELOPMENT\'\n' f.write(line) -def set_installshield(version): - for ism in ['win_build/installerv2/BOINCx64_vbox.ism', 'win_build/installerv2/BOINCx64.ism']: - with open(ism, 'r') as f: - lines = f.readlines() - with open(ism, 'w') as f: - for line in lines: - if line.startswith(' ProductVersion'): - line = f' ProductVersion{version}\n' - f.write(line) +def set_boinc_json(version): + with open('installer/boinc.json','r') as f: + data = json.load(f) + for item in data['Property']: + if item['Property'] == 'ProductVersion': + item['Value'] = version + break + with open('installer/boinc.json','w') as f: + json.dump(data, f, indent=4) def set_snapcraft(version): with open('snap/snapcraft.yaml','r') as f: @@ -133,7 +134,7 @@ def set_snap_boinc_desktop(version): set_version_h(version) set_version_h_in(version) set_build_gradle(version) -set_installshield(version) +set_boinc_json(version) set_snapcraft(version) set_snap_boinc_desktop(version)