-
-__author__ = "github.com/AndrewSazonov"
-__version__ = '0.0.1'
-
-import os, sys
-import ffmpeg
-import Functions, Config
-
-
-CONFIG = Config.Config()
-
-def inputPattern():
- return f'{CONFIG.screenshots_dir}/*.png'
-
-def outputPath():
- file_suffix = Functions.artifactsFileSuffix(sys.argv[1])
- return os.path.join(CONFIG.dist_dir, f'tutorial{CONFIG.setup_name_suffix}{file_suffix}.mp4')
-
-def outputOptions():
- # https://trac.ffmpeg.org/wiki/Encode/H.264
- # https://slhck.info/video/2017/02/24/crf-guide.html
- # https://kkroening.github.io/ffmpeg-python/
- # https://github.com/kkroening/ffmpeg-python/issues/95
- return {
- 'crf': CONFIG['ci']['app']['tutorials']['video']['crf'],
- 'preset': CONFIG['ci']['app']['tutorials']['video']['preset'],
- 'movflags': CONFIG['ci']['app']['tutorials']['video']['movflags'],
- 'pix_fmt': CONFIG['ci']['app']['tutorials']['video']['pix_fmt']
- }
-
-def fps():
- return CONFIG['ci']['app']['tutorials']['video']['fps']
-
-def writeVideo():
- (
- ffmpeg
- .input(inputPattern(), pattern_type='glob', framerate=fps())
- .filter('scale', size='1280x768')
- .output(outputPath(), **outputOptions())
- .run(overwrite_output=True)
- )
-
-def ffmpegZippedFileName():
- version = CONFIG['ci']['ffmpeg']['macos']['version']
- file_name_base = CONFIG['ci']['ffmpeg']['macos']['file_name_base']
- file_ext = CONFIG['ci']['ffmpeg']['macos']['file_ext']
- return f'{file_name_base}{version}{file_ext}'
-
-def ffmpegUnzippedFilePath():
- exe = CONFIG['ci']['ffmpeg']['macos']['exe']
- return os.path.join(CONFIG.download_dir, exe)
-
-def ffmpegDownloadUrl():
- base_url = CONFIG['ci']['ffmpeg']['macos']['base_url']
- return f'{base_url}/{ffmpegZippedFileName()}'
-
-def ffmpegDownloadDest():
- return os.path.join(CONFIG.download_dir, f'{ffmpegZippedFileName()}')
-
-def downloadFfmpeg():
- Functions.downloadFile(
- url=ffmpegDownloadUrl(),
- destination=ffmpegDownloadDest()
- )
-
-def unzipFfmpeg():
- if os.path.exists(ffmpegUnzippedFilePath()):
- Functions.printNeutralMessage(f'File already exists {ffmpegUnzippedFilePath()}')
- return
- Functions.unzip(ffmpegDownloadDest(), CONFIG.download_dir)
- Functions.addReadPermission(ffmpegUnzippedFilePath())
-
-def addDownloadDestToPath():
- path = Functions.environmentVariable('PATH')
- download_dest = os.path.abspath(CONFIG.download_dir)
- Functions.setEnvironmentVariable('PATH', f'{download_dest}:{path}')
-
-if __name__ == "__main__":
- #downloadFfmpeg()
- #unzipFfmpeg()
- #addDownloadDestToPath()
- #writeVideo()
- Functions.copyFile('tutorial.mp4', outputPath())
diff --git a/tools/Scripts/Functions.py b/tools/Scripts/Functions.py
index 251150cd..bbe05d8a 100755
--- a/tools/Scripts/Functions.py
+++ b/tools/Scripts/Functions.py
@@ -326,9 +326,3 @@ def zip(source, destination):
sys.exit()
else:
printSuccessMessage(message)
-
-
-def artifactsFileSuffix(branch_name):
- if branch_name != 'master':
- return f'_{branch_name}'
- return ''
diff --git a/tools/Scripts/InstallerControlScript.js b/tools/Scripts/InstallerControlScript.js
index bc519217..4ce21d63 100644
--- a/tools/Scripts/InstallerControlScript.js
+++ b/tools/Scripts/InstallerControlScript.js
@@ -14,8 +14,8 @@ Controller.prototype.IntroductionPageCallback = function()
if (installer.isInstaller())
{
var msg = ""
- msg += "Welcome to the easyDiffraction Setup Wizard.
"
- msg += "easyDiffraction is a scientific software for modelling and analysis of diffraction data.
"
+ msg += "Welcome to the EasyDiffraction Setup Wizard.
"
+ msg += "EasyDiffraction is a scientific software for modelling and analysis of diffraction data.
"
msg += "For more details, please visit https://easydiffraction.org
"
page.MessageLabel.setText(msg)
}
diff --git a/tools/Scripts/InstallerInstallScript.js b/tools/Scripts/InstallerInstallScript.js
index 0e0fa5f0..f536a2e0 100644
--- a/tools/Scripts/InstallerInstallScript.js
+++ b/tools/Scripts/InstallerInstallScript.js
@@ -97,15 +97,15 @@ Component.prototype.createOperations = function()
component.addOperation(
"Copy",
- "@TargetDir@/easyDiffraction.desktop",
- "@HomeDir@/.local/share/applications/easyDiffraction.desktop"
+ "@TargetDir@/@ProductName@.desktop",
+ "@HomeDir@/.local/share/applications/@ProductName@.desktop"
)
/*
component.addOperation(
"Copy",
- "@TargetDir@/easyDiffraction.desktop",
- "/usr/share/applications/easyDiffraction.desktop"
+ "@TargetDir@/@ProductName@.desktop",
+ "/usr/share/applications/@ProductName@.desktop"
)
*/
}
diff --git a/tools/Scripts/MakeInstaller.py b/tools/Scripts/MakeInstaller.py
index 87c005da..e40f7020 100644
--- a/tools/Scripts/MakeInstaller.py
+++ b/tools/Scripts/MakeInstaller.py
@@ -11,7 +11,6 @@
import xml.dom.minidom
import dephell_licenses
import Functions, Config
-import Signatures
CONFIG = Config.Config()
@@ -251,23 +250,6 @@ def installQtInstallerFramework():
else:
Functions.printSuccessMessage(message)
-def prepareSignedMaintenanceTool():
- if CONFIG.setup_os != "Windows":
- return
- try:
- message = 'copy and sign MaintenanceTool'
- target_dir = CONFIG['ci']['project']['subdirs']['certificates_path']
- target_file = os.path.join(target_dir, "signedmaintenancetool.exe")
- # copy MaintenanceTool locally
- Functions.copyFile(os.path.join(qtifwDirPath(), "bin", "installerbase.exe" ), target_file)
- Signatures.unzipCerts(zip_pass=sys.argv[2])
- Signatures.sign_windows(file_to_sign=target_file, cert_pass=sys.argv[1])
- except Exception as exception:
- Functions.printFailMessage(message, exception)
- sys.exit(1)
- else:
- Functions.printSuccessMessage(message)
-
def createInstallerSourceDir():
try:
message = f'create installer source directory {setupBuildDirPath()}'
@@ -298,11 +280,6 @@ def createInstallerSourceDir():
Functions.moveDir(source=freezed_app_src, destination=app_data_subsubdir_path)
Functions.copyFile(source=CONFIG.license_file, destination=app_data_subsubdir_path)
Functions.copyFile(source=CONFIG['release']['changelog_file'], destination=app_data_subsubdir_path)
- # TODO: change the handling of failure in all methods in Functions.py so they bubble up exceptions
- # TODO: remove this platform conditional once the above is done
- if CONFIG.os == 'windows':
- Functions.copyFile(source=CONFIG.maintenancetool_file, destination=app_data_subsubdir_path)
-
# package: docs
##docs_subdir_path = os.path.join(packagesDirPath(), CONFIG['ci']['app']['setup']['build']['docs_package_subdir'])
##docs_data_subsubdir_path = os.path.join(docs_subdir_path, CONFIG['ci']['app']['setup']['build']['data_subsubdir'])
@@ -322,8 +299,6 @@ def createInstallerSourceDir():
#Functions.copyDir(source=examples_dir_src, destination=os.path.join(app_data_subsubdir_path, examples_dir_dest))
# TODO: change the handling of failure in all methods in Functions.py so they bubble up exceptions
# TODO: remove this platform conditional once the above is done
- if CONFIG.os == 'windows':
- Functions.copyFile(source=CONFIG.maintenancetool_file, destination=app_data_subsubdir_path)
except Exception as exception:
Functions.printFailMessage(message, exception)
sys.exit(1)
@@ -332,7 +307,7 @@ def createInstallerSourceDir():
def createOfflineInstaller():
try:
- message = 'create installer'
+ message = 'create offline installer'
qtifw_bin_dir_path = os.path.join(qtifwDirPath(), 'bin')
qtifw_binarycreator_path = os.path.join(qtifw_bin_dir_path, 'binarycreator')
qtifw_installerbase_path = os.path.join(qtifw_bin_dir_path, 'installerbase')
@@ -387,7 +362,6 @@ def addFilesToLocalRepository():
downloadQtInstallerFramework()
osDependentPreparation()
installQtInstallerFramework()
- prepareSignedMaintenanceTool()
createInstallerSourceDir()
createOfflineInstaller()
createOnlineRepositoryLocally()
diff --git a/tools/Scripts/RenameTestVideos.py b/tools/Scripts/RenameTestVideos.py
new file mode 100755
index 00000000..d3568c69
--- /dev/null
+++ b/tools/Scripts/RenameTestVideos.py
@@ -0,0 +1,21 @@
+# SPDX-FileCopyrightText: 2021 easyDiffraction contributors
+# SPDX-License-Identifier: BSD-3-Clause
+# © 2021 Contributors to the easyDiffraction project
+
+__author__ = "github.com/AndrewSazonov"
+__version__ = '0.0.1'
+
+import os, sys
+import Functions, Config
+
+
+CONFIG = Config.Config(sys.argv[1])
+
+def inputPath():
+ return 'tutorial.mp4'
+
+def outputPath():
+ return CONFIG.video_tutorial_path
+
+if __name__ == "__main__":
+ Functions.copyFile(inputPath(), outputPath())
diff --git a/tools/Scripts/RunApp.py b/tools/Scripts/RunApp.py
index ccefe506..5dd945bd 100644
--- a/tools/Scripts/RunApp.py
+++ b/tools/Scripts/RunApp.py
@@ -35,5 +35,6 @@ def runApp():
else:
Functions.printSuccessMessage(message)
+
if __name__ == "__main__":
runApp()
diff --git a/tools/Scripts/SignAppInstaller.py b/tools/Scripts/SignAppInstaller.py
new file mode 100644
index 00000000..9572a946
--- /dev/null
+++ b/tools/Scripts/SignAppInstaller.py
@@ -0,0 +1,276 @@
+# SPDX-FileCopyrightText: 2021 easyDiffraction contributors
+# SPDX-License-Identifier: BSD-3-Clause
+# © 2021 Contributors to the easyDiffraction project
+
+__author__ = "github.com/AndrewSazonov"
+__version__ = '0.0.1'
+
+import os
+import sys
+import time
+import base64
+import Config
+import Functions
+
+
+CONFIG = Config.Config(sys.argv[1])
+
+MACOS_IDENTITY = CONFIG['ci']['codesign']['macos']['identity']
+MACOS_CERTIFICATE_ENCODED = sys.argv[2] # Encoded content of the certificate.p12 file
+MACOS_CERTIFICATE_PASSWORD = sys.argv[3] # Password associated with the certificate.p12 file
+APPSTORE_NOTARIZATION_USERNAME = sys.argv[4] # Apple ID (esss.se personal account) added to https://developer.apple.com
+APPSTORE_NOTARIZATION_PASSWORD = sys.argv[5] # App specific password for EasyDiffraction from https://appleid.apple.com
+
+def signLinux():
+ Functions.printNeutralMessage('No code signing needed for linux')
+ return
+
+def signWindows():
+ Functions.printNeutralMessage('Code signing on Windows is not supported yet')
+ return
+
+def signMacos():
+ try:
+ ##########################
+ # Prepare for code signing
+ ##########################
+
+ message = f'sign code on {CONFIG.os}'
+ keychain_name = 'codesign.keychain'
+ keychain_password = 'password'
+ mac_certificate_fpath = 'certificate.p12'
+
+ try:
+ sub_message = f'create keychain "{keychain_name}"'
+ Functions.run(
+ 'security', 'create-keychain',
+ '-p', keychain_password,
+ keychain_name)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'set created keychain "{keychain_name}" to be default keychain'
+ Functions.run(
+ 'security', 'default-keychain',
+ '-s', keychain_name)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'list keychains'
+ Functions.run(
+ 'security', 'list-keychains')
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'unlock created keychain "{keychain_name}"'
+ Functions.run(
+ 'security', 'unlock-keychain',
+ '-p', keychain_password,
+ keychain_name)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'create certificate file "{mac_certificate_fpath}"'
+ certificate_decoded = base64.b64decode(MACOS_CERTIFICATE_ENCODED)
+ with open(mac_certificate_fpath, 'wb') as f:
+ f.write(certificate_decoded)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'import certificate "{mac_certificate_fpath}" to created keychain "{keychain_name}"'
+ Functions.run(
+ 'security', 'import',
+ mac_certificate_fpath,
+ '-k', keychain_name,
+ '-P', MACOS_CERTIFICATE_PASSWORD,
+ '-T', '/usr/bin/codesign')
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'show certificates'
+ Functions.run(
+ 'security', 'find-identity',
+ '-v')
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'allow codesign to access certificate key from keychain "{keychain_name}"'
+ Functions.run(
+ 'security', 'set-key-partition-list',
+ '-S', 'apple-tool:,apple:,codesign:',
+ '-s',
+ '-k', keychain_password, keychain_name)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ ####################
+ # Sign app installer
+ ####################
+
+ try:
+ sub_message = f'sign installer app "{CONFIG.setup_exe_path}" with imported certificate'
+ Functions.run(
+ 'codesign',
+ '--deep', # nested code content such as helpers, frameworks, and plug-ins, should be recursively signed
+ '--force', # replace any existing signature on the path(s) given
+ '--verbose=1', # set (with a numeric value) or increments the verbosity level of output
+ '--timestamp', # request that a default Apple timestamp authority server be contacted to authenticate the time of signin
+ '--options=runtime', # specify a set of option flags to be embedded in the code signature
+ '--sign', MACOS_IDENTITY, # sign the code at the path(s) given using this identity
+ CONFIG.setup_exe_path)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'verify app signatures for installer "{CONFIG.setup_exe_path}"'
+ Functions.run(
+ 'codesign',
+ '--verify', # verification of code signatures
+ '--verbose=1', # set (with a numeric value) or increments the verbosity level of output
+ CONFIG.setup_exe_path)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ ########################
+ # Notarize app installer
+ ########################
+
+ try:
+ sub_message = f'create zip archive "{CONFIG.setup_zip_path_short}" of offline app installer "{CONFIG.setup_exe_path}" for notarization'
+ #Functions.zip(CONFIG.setup_exe_path, CONFIG.setup_zip_path_short)
+ Functions.run(
+ 'ditto',
+ '-c',
+ '-k',
+ '--rsrc',
+ '--sequesterRsrc',
+ CONFIG.setup_exe_path,
+ CONFIG.setup_zip_path_short)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'notarize app installer "{CONFIG.setup_zip_path_short}" for distribution outside of the Mac App Store' # Notarize the app by submitting a zipped package of the app bundle
+ Functions.run(
+ 'xcrun', 'altool',
+ '--notarize-app',
+ '--file', CONFIG.setup_zip_path_short,
+ '--type', 'macos',
+ '--primary-bundle-id', CONFIG['ci']['codesign']['bundle_id'],
+ '--username', APPSTORE_NOTARIZATION_USERNAME,
+ '--password', APPSTORE_NOTARIZATION_PASSWORD)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'delete submitted zip "{CONFIG.setup_zip_path_short}" of notarized app installer'
+ Functions.removeFile(CONFIG.setup_zip_path_short)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ ######################
+ # Staple app installer
+ ######################
+
+ try:
+ sub_message = f'download and attach (staple) tickets for notarized executables to app installer "{CONFIG.setup_exe_path}"'
+ time.sleep(180) # Sleep for 3 minutes before calling the stapler to handle notarization lag on Apple server
+ # Or maybe one could instead get 'RequestUUID' from the previous 'xcrun altool --notarize-app...' output and
+ # check in the loop until notarization is succeded via 'xcrun altool --notarization-info UUID...'?
+ # If notarization is in progress, the '--notarization-info' output should contain 'Status: in progress'
+ # If notarization is succeded, the '--notarization-info' output should contain 'Status: success'
+ Functions.run(
+ 'xcrun', 'stapler',
+ 'staple', CONFIG.setup_exe_path)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'verify the stapled tickets of app installer "{CONFIG.setup_exe_path}"'
+ Functions.run(
+ 'xcrun', 'stapler',
+ 'validate', CONFIG.setup_exe_path)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ try:
+ sub_message = f'verify notarization of app installer "{CONFIG.setup_exe_path}"'
+ Functions.run(
+ 'spctl',
+ '--assess',
+ '--vv',
+ CONFIG.setup_exe_path)
+ except Exception as sub_exception:
+ Functions.printFailMessage(sub_message, sub_exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(sub_message)
+
+ except Exception as exception:
+ Functions.printFailMessage(message, exception)
+ sys.exit(1)
+ else:
+ Functions.printSuccessMessage(message)
+
+
+if __name__ == "__main__":
+ if CONFIG.os == 'ubuntu':
+ signLinux()
+ elif CONFIG.os == 'windows':
+ signWindows()
+ elif CONFIG.os == 'macos':
+ signMacos()
+ else:
+ raise AttributeError(f"OS '{CONFIG.os}' is not supported")
diff --git a/tools/Scripts/Signatures.py b/tools/Scripts/Signatures.py
deleted file mode 100644
index 4996dfed..00000000
--- a/tools/Scripts/Signatures.py
+++ /dev/null
@@ -1,132 +0,0 @@
-# SPDX-FileCopyrightText: 2022 easyDiffraction contributors
-# SPDX-License-Identifier: BSD-3-Clause
-# © 2021-2022 Contributors to the easyDiffraction project
-
-import os
-import sys
-import zipfile
-import Config
-import Functions
-
-
-CONFIG = Config.Config()
-
-app_name = CONFIG.app_name
-app_url = CONFIG['tool']['poetry']['homepage']
-installer_exe_path = os.path.join(CONFIG.dist_dir, CONFIG.setup_full_name)
-
-certificates_dir_path = CONFIG['ci']['project']['subdirs']['certificates_path']
-certificate_file_path = CONFIG.certificate_path
-certificates_zip_path = CONFIG.certificate_zip_path
-
-
-def unzipCerts(zip_pass=None):
-
- if zip_pass is None:
- zip_pass = sys.argv[2]
-
- print('* Unzip certificates')
- with zipfile.ZipFile(certificates_zip_path) as zf:
- zf.extractall(
- path=certificates_dir_path,
- pwd=bytes(zip_pass, 'utf-8'))
-
-
-def sign_linux():
- print('* No code signing needed for linux')
- return
-
-
-def sign_windows(file_to_sign=installer_exe_path, cert_pass=None):
- print('* Code signing for windows')
- if cert_pass is None:
- cert_pass = sys.argv[1]
- # using local signtool, since installing the whole SDK is a total overkill
- # signtool_exe_path = os.path.join('C:', os.sep, 'Program Files (x86)', 'Windows Kits', '10', 'bin', 'x86', 'signtool.exe')
- signtool_exe_path = os.path.join(certificates_dir_path, 'signtool.exe')
-
- win_certificate_file_path = certificate_file_path + ".pfx"
-
- print('* Sign code with imported certificate')
- Functions.run(
- signtool_exe_path, 'sign', # info - https://msdn.microsoft.com/en-us/data/ff551778(v=vs.71)
- '/f', win_certificate_file_path, # signing certificate in a file
- '/p', cert_pass, # password to use when opening a PFX file
- '/d', app_name, # description of the signed content
- '/du', app_url, # URL for the expanded description of the signed content
- '/t', 'http://timestamp.digicert.com', # URL to a timestamp server
- '/v', # display the verbose version of operation and warning messages
- '/a', # Select the best signing cert automatically
- file_to_sign)
-
-
-def sign_macos():
- print('* Code signing on MacOS is disabled.')
- return
- keychain_name = 'codesign.keychain'
- keychain_password = 'password'
- mac_certificate_file_path = certificate_file_path + ".p12"
- identity = 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)'
-
- print('* Create keychain')
- Functions.run(
- 'security', 'create-keychain',
- '-p', keychain_password,
- keychain_name)
-
- print('* Set it to be default keychain')
- Functions.run(
- 'security', 'default-keychain',
- '-s', keychain_name)
-
- print('* List keychains')
- Functions.run(
- 'security', 'list-keychains')
-
- print('* Unlock created keychain')
- Functions.run(
- 'security', 'unlock-keychain',
- '-p', keychain_password,
- keychain_name)
-
- print('* Import certificate to created keychain')
- Functions.run(
- 'security', 'import',
- mac_certificate_file_path,
- '-k', keychain_name,
- '-P', certificate_password,
- '-T', '/usr/bin/codesign')
-
- print('* Show certificates')
- Functions.run(
- 'security', 'find-identity',
- '-v')
-
- print('* Allow codesign to access certificate key from keychain')
- Functions.run(
- 'security', 'set-key-partition-list',
- '-S', 'apple-tool:,apple:,codesign:',
- '-s',
- '-k', keychain_password)
-
- print('* Sign code with imported certificate')
- Functions.run(
- 'codesign',
- '--deep',
- '--force',
- '--verbose',
- # --timestamp URL
- '--sign', identity,
- installer_exe_path)
-
-
-if __name__ == "__main__":
- unzipCerts()
- if CONFIG.os == 'ubuntu':
- sign_linux()
- elif CONFIG.os == 'windows':
- sign_windows()
- elif CONFIG.os == 'macos':
- sign_macos()
- else:
- raise AttributeError("Incorrect OS")
diff --git a/tools/Scripts/ZipArtifacts.py b/tools/Scripts/ZipAppInstaller.py
similarity index 65%
rename from tools/Scripts/ZipArtifacts.py
rename to tools/Scripts/ZipAppInstaller.py
index b27abed3..ef0c4f2b 100755
--- a/tools/Scripts/ZipArtifacts.py
+++ b/tools/Scripts/ZipAppInstaller.py
@@ -9,19 +9,16 @@
import Functions, Config
-CONFIG = Config.Config()
+CONFIG = Config.Config(sys.argv[1])
def source():
return CONFIG.setup_exe_path
def destination():
- file_suffix = Functions.artifactsFileSuffix(sys.argv[1])
- setup_zip_name = f'{CONFIG.setup_name}{file_suffix}.zip'
- setup_zip_path = os.path.join(CONFIG.dist_dir, setup_zip_name)
- return setup_zip_path
+ return CONFIG.setup_zip_path
-def zip():
+def zipAppInstaller():
Functions.zip(source(), destination())
if __name__ == "__main__":
- zip()
+ zipAppInstaller()