(self)
| 539 | |
| 540 | class NSISScript(object): |
| 541 | def create(self): |
| 542 | fileList, totalSize = self.getBuildDirContents(OUT_DIR) |
| 543 | print("Total size eq: {}".format(totalSize)) |
| 544 | installFiles = self.prepareInstallListTemplate(fileList) |
| 545 | uninstallFiles = self.prepareDeleteListTemplate(fileList) |
| 546 | |
| 547 | if os.path.isfile(SETUP_SCRIPT_PATH): |
| 548 | raise RuntimeError("Cannot create setup script, file exists at {}".format(SETUP_SCRIPT_PATH)) |
| 549 | contents = Template(NSIS_SCRIPT_TEMPLATE).substitute( |
| 550 | version=syncplay.version, |
| 551 | uninstallFiles=uninstallFiles, |
| 552 | installFiles=installFiles, |
| 553 | totalSize=totalSize, |
| 554 | ) |
| 555 | with codecs.open(SETUP_SCRIPT_PATH, "w", "utf-8-sig") as outfile: |
| 556 | outfile.write(contents) |
| 557 | |
| 558 | def compile(self): |
| 559 | if not os.path.isfile(NSIS_COMPILE): |
no test coverage detected