From e01bc0893ca25318690ee6427ece8f82afa59861 Mon Sep 17 00:00:00 2001 From: Apex Liu Date: Mon, 10 Dec 2018 00:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4win=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC=E5=92=8C=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/builder/build-version.py | 71 +++++++++++++++-------- dist/client/windows/assist/installer.nsi | Bin 2828 -> 2974 bytes dist/client/windows/assist/main.nsh | Bin 1890 -> 1848 bytes dist/client/windows/assist/setup.nsh | Bin 28134 -> 28116 bytes 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/build/builder/build-version.py b/build/builder/build-version.py index c0de736..7b4c8d5 100644 --- a/build/builder/build-version.py +++ b/build/builder/build-version.py @@ -299,10 +299,10 @@ class Builder: def _update_ver_nsi(self, nsiFilePath, ver): """ update nsis file version info """ t_ver = ver.split('.') - while len(t_ver) < 4: + while len(t_ver) < 3: t_ver.append('0') - if len(t_ver) > 4: + if len(t_ver) > 3: raise RuntimeError('Invalid version for nsis file.') bOK = False @@ -319,40 +319,61 @@ class Builder: if nsiline.find('\n') != -1: nsiline = nsiline[:-1] - if nsiline.find(" FILE_VER") != -1 or nsiline.find(" STR_FILE_VER") != -1: - # cc.v('[ver] old ver: %s' % nsiLines[x]) - pos1 = nsiline.find('"') - pos2 = nsiline.rfind('"') - _ver = nsiline[pos1 + 1: pos2] + # if nsiline.find(" FILE_VER") != -1 or nsiline.find(" STR_FILE_VER") != -1: + if nsiline.startswith("!define FILE_VER"): + # # cc.v('[ver] old ver: %s' % nsiLines[x]) + # pos1 = nsiline.find('"') + # pos2 = nsiline.rfind('"') + # _ver = nsiline[pos1 + 1: pos2] - nsiSplitList = _ver.split(".") - if (len(nsiSplitList) != 4): - raise RuntimeError('Invalid .nsi file (1).') - if '.'.join(nsiSplitList) == ver: - continue + # nsiSplitList = _ver.split(".") + # if (len(nsiSplitList) != 3): + # raise RuntimeError('Invalid .nsi file (1).') + # if '.'.join(nsiSplitList) == ver: + # continue - # nsiline = '%s\"%d.%d.%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor, self.revision, self.build) - nsiline = '%s\"%s.%s.%s.%s\"\n' % (nsiline[0:pos1], t_ver[0], t_ver[1], t_ver[2], t_ver[3]) + # # nsiline = '%s\"%d.%d.%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor, self.revision, self.build) + nsiline = '!define FILE_VER \"%s.%s.%s.0\"\n' % (t_ver[0], t_ver[1], t_ver[2]) nsiLines[x] = "" nsiLines[x] = nsiline # cc.v('[ver] new ver: %s' % nsiLines[x]) bOK = True - elif nsiline.find(" PRODUCT_VER") != -1: - # cc.v('[ver] old ver: %s' % nsiLines[x]) - pos1 = nsiline.find('"') - pos2 = nsiline.rfind('"') - _ver = nsiline[pos1 + 1: pos2] + # elif nsiline.find(" OUT_VER") != -1 or nsiline.find(" STR_OUT_VER") != -1: + elif nsiline.startswith("!define OUT_VER"): + # # cc.v('[ver] old ver: %s' % nsiLines[x]) + # pos1 = nsiline.find('"') + # pos2 = nsiline.rfind('"') + # _ver = nsiline[pos1 + 1: pos2] - nsiSplitList = _ver.split(".") - if (len(nsiSplitList) != 2): - raise RuntimeError('Invalid .nsi file (2).') - if '.'.join(nsiSplitList) == '%s.%s' % (t_ver[0], t_ver[1]): - continue + # nsiSplitList = _ver.split(".") + # if (len(nsiSplitList) != 3): + # raise RuntimeError('Invalid .nsi file (1).') + # if '.'.join(nsiSplitList) == ver: + # continue + + # nsiline = '%s\"%d.%d.%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor, self.revision, self.build) + nsiline = '!define OUT_VER \"%s.%s.%s\"\n' % (t_ver[0], t_ver[1], t_ver[2]) + + nsiLines[x] = "" + nsiLines[x] = nsiline + # cc.v('[ver] new ver: %s' % nsiLines[x]) + bOK = True + elif nsiline.startswith("!define PRODUCT_VER"): + # # cc.v('[ver] old ver: %s' % nsiLines[x]) + # pos1 = nsiline.find('"') + # pos2 = nsiline.rfind('"') + # _ver = nsiline[pos1 + 1: pos2] + + # nsiSplitList = _ver.split(".") + # if (len(nsiSplitList) != 2): + # raise RuntimeError('Invalid .nsi file (2).') + # if '.'.join(nsiSplitList) == '%s.%s' % (t_ver[0], t_ver[1]): + # continue # nsiline = '%s\"%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor) - nsiline = '%s\"%s.%s\"\n' % (nsiline[0:pos1], t_ver[0], t_ver[1]) + nsiline = '!define PRODUCT_VER \"%s.%s\"\n' % (t_ver[0], t_ver[1]) nsiLines[x] = "" nsiLines[x] = nsiline diff --git a/dist/client/windows/assist/installer.nsi b/dist/client/windows/assist/installer.nsi index c12f4beb7b31c4ccb6b480f05070f649d8e89281..d06c169249b20d4b4937c416b688e582db01c09b 100644 GIT binary patch delta 496 zcmeAXn6$jdM}gVB$Xck)(7Lw2YV zpz4VVO6(BDyps!AgeT8n(qje5LU^~BtbjTSS+pnHF{^=D%9G!5@lBq>Y#x*PhQ1VB93ZaEyy0Q8OH3EKvjyI>XRq2ivd~7+0~hVVR()m6e8>#hCtGs!&w{> zl8Owe40#MG44DjRQ0?6u!9W$D5dFYm1Y{|4+Ji~M$rCumIALMOJNY7~_~ZkeLO{8T coZ3(a{^dLf?I5Z3?>YTlNZJdPj-k8LE=YpLgg5gCNugbPi|mTn!JILWAn6x G0A2vQSrjS& delta 78 zcmca|oAKFg#tjPbyr~TN47m)&Kr)S?WU_jEI-1DT_(*;fH4I9V8GVx{H!vzq-oVJQ Jxg{Zh7XY^Y7XAPL