From 50c4f777abbcb00537012c6068552632ac3d7017 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Wed, 11 Jan 2023 16:08:06 +0100 Subject: [PATCH 01/18] Fix Cura being moved on install CURA-6867 --- packaging/MacOS/build_macos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index 06880cf9b7..ded6baee74 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -24,6 +24,7 @@ def build_pkg(dist_path: str, app_filename: str, component_filename: str, instal # This builds the component package that contains UltiMaker-Cura.app. This component package will be bundled in a distribution package. pkg_build_arguments = [ pkg_build_executable, + "--identifier", ULTIMAKER_CURA_DOMAIN, "--component", Path(dist_path, app_filename), Path(dist_path, component_filename), From ca34fe2d2d7206c9dec550b78d39521d25d97263 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Wed, 11 Jan 2023 16:47:59 +0100 Subject: [PATCH 02/18] Change display now to include enterprise for MacOS Add CFBundleVersionString, this might fix the app not showing up in search. CURA-6867 --- UltiMaker-Cura.spec.jinja | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UltiMaker-Cura.spec.jinja b/UltiMaker-Cura.spec.jinja index ba5b6e11c2..23ac916c42 100644 --- a/UltiMaker-Cura.spec.jinja +++ b/UltiMaker-Cura.spec.jinja @@ -253,7 +253,7 @@ class UMBUNDLE(BUNDLE): app = UMBUNDLE( coll, - name='{{ name }}.app', + name='{{ display_name }}.app'.replace(" ", "-"), icon={{ icon }}, bundle_identifier={{ osx_bundle_identifier }}, version={{ version }}, @@ -264,6 +264,7 @@ app = UMBUNDLE( 'CFBundleExecutable': '{{ name }}', 'CFBundleInfoDictionaryVersion': '6.0', 'CFBundlePackageType': 'APPL', + 'CFBundleVersionString': {{ version }}, 'CFBundleShortVersionString': {{ short_version }}, 'CFBundleDocumentTypes': [{ 'CFBundleTypeRole': 'Viewer', From 05e1f57324d4808519afd469679442240429d9a6 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Thu, 12 Jan 2023 13:24:28 +0100 Subject: [PATCH 03/18] Revert dmg deprecation CURA-6867 --- .github/workflows/cura-all-installers.yml | 27 ++++++++++++-- .github/workflows/cura-installer.yml | 11 ++++-- packaging/MacOS/build_macos.py | 43 ++++++++++++++++++++++- 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cura-all-installers.yml b/.github/workflows/cura-all-installers.yml index b024d035a5..7f0002894a 100644 --- a/.github/workflows/cura-all-installers.yml +++ b/.github/workflows/cura-all-installers.yml @@ -1,5 +1,5 @@ name: Cura All Installers -run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, appimage ${{ inputs.build_linux }} - enterprise ${{ inputs.enterprise }} +run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, pkg ${{ inputs.build_macos_installer }}, appimage ${{ inputs.build_linux }} - enterprise ${{ inputs.enterprise }} on: workflow_dispatch: @@ -50,7 +50,12 @@ on: required: true type: boolean build_macos: - description: 'Build for MacOS' + description: 'Build dmg for MacOS' + default: true + required: true + type: boolean + build_macos_installer: + description: 'Build pkg for MacOS' default: true required: true type: boolean @@ -120,7 +125,7 @@ jobs: msi_installer: false secrets: inherit - macos-installer-create: + macos-dmg-create: if: ${{ inputs.build_macos }} uses: ./.github/workflows/cura-installer.yml with: @@ -134,3 +139,19 @@ jobs: installer: ${{ inputs.installer }} msi_installer: false secrets: inherit + + macos-installer-create: + if: ${{ inputs.build_macos }} + uses: ./.github/workflows/cura-installer.yml + with: + platform: 'macos-11' + os_name: 'mac' + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + conan_config: ${{ inputs.conan_config }} + enterprise: ${{ inputs.enterprise }} + staging: ${{ inputs.staging }} + installer: ${{ inputs.installer }} + msi_installer: false + pkg_installer: true + secrets: inherit diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index fef4547891..e96f1ca781 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -49,6 +49,11 @@ on: default: false required: true type: boolean + pkg_installer: + description: 'Create the pkg' + default: false + required: true + type: boolean env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} @@ -120,7 +125,7 @@ jobs: - name: Install MacOS system requirements if: ${{ runner.os == 'Macos' }} - run: brew install autoconf automake ninja + run: brew install autoconf automake ninja create-dmg - name: Install Linux system requirements if: ${{ runner.os == 'Linux' }} @@ -251,7 +256,7 @@ jobs: if "${{ runner.os }}" == "Windows": installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe" elif "${{ runner.os }}" == "macOS": - installer_ext = "pkg" + installer_ext = "pkg" if "${{ inputs.pkg_installer }}" == "true" else "dmg" else: installer_ext = "AppImage" output_env = os.environ["GITHUB_OUTPUT"] @@ -308,7 +313,7 @@ jobs: run: python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - - name: Create the MacOS pkg (Bash) + - name: Create the MacOS dmg and/or pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} run: python ../cura_inst/packaging/MacOS/build_macos.py . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index ded6baee74..ed2605594e 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -9,6 +9,24 @@ from pathlib import Path ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura") +def build_dmg(source_path: str, dist_path: str, filename: str) -> None: + create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg") + + arguments = [create_dmg_executable, + "--window-pos", "640", "360", + "--window-size", "690", "503", + "--app-drop-link", "520", "272", + "--volicon", f"{source_path}/packaging/icons/VolumeIcons_Cura.icns", + "--icon-size", "90", + "--icon", "UltiMaker-Cura.app", "169", "272", + "--eula", f"{source_path}/packaging/cura_license.txt", + "--background", f"{source_path}/packaging/MacOs/cura_background_dmg.png", + f"{dist_path}/{filename}", + f"{dist_path}/UltiMaker-Cura.app"] + + subprocess.run(arguments) + + def build_pkg(dist_path: str, app_filename: str, component_filename: str, installer_filename: str) -> None: """ Builds and signs the pkg installer. @@ -102,10 +120,33 @@ def create_pkg_installer(filename: str, dist_path: str) -> None: if notarize: notarize_file(dist_path, filename) + +def create_dmg(filename: str, dist_path: str, source_path: str) -> None: + """ Creates a dmg executable from UltiMaker-Cura.app named {filename}.dmg + + @param filename: The name of the app file and the output dmg file without the extension + @param dist_path: The location to read the app from and save the dmg to + @param source_path: The location of the project source files + """ + + dmg_filename = f"{filename}.dmg" + + build_dmg(source_path, dist_path, dmg_filename) + + notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE")) + if notarize_dmg: + notarize_file(dist_path, dmg_filename) + + if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Create installer for Cura.") parser.add_argument("dist_path", type = str, help="Path to Pyinstaller dist folder") parser.add_argument("filename", type = str, help = "Filename of the pkg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg')") args = parser.parse_args() - create_pkg_installer(args.filename, args.dist_path) + if Path(args.filename).suffix == ".pkg": + create_pkg_installer(args.filename, args.dist_path) + elif Path(args.filename).suffix == ".dmg": + create_dmg(args.filename, args.dist_path, args.source_path) + else: + create_dmg(args.filename, args.dist_path, args.source_path) From e25730ad77f60be4f067faa8c0bd1f1fbe5d4fbd Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Thu, 12 Jan 2023 14:15:53 +0100 Subject: [PATCH 04/18] We hit the max 10 inputs for the workflow. Remove the pkg input and use the msi one temporarily instead. CURA-6867 --- .github/workflows/cura-all-installers.yml | 10 ++-------- .github/workflows/cura-installer.yml | 7 +------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cura-all-installers.yml b/.github/workflows/cura-all-installers.yml index 7f0002894a..4729c4198a 100644 --- a/.github/workflows/cura-all-installers.yml +++ b/.github/workflows/cura-all-installers.yml @@ -40,7 +40,7 @@ on: required: true type: boolean build_windows_msi: - description: 'Build for Windows msi' + description: 'Build for msi+pkg' default: true required: true type: boolean @@ -54,11 +54,6 @@ on: default: true required: true type: boolean - build_macos_installer: - description: 'Build pkg for MacOS' - default: true - required: true - type: boolean # Run the nightly at 3:25 UTC on working days schedule: @@ -152,6 +147,5 @@ jobs: enterprise: ${{ inputs.enterprise }} staging: ${{ inputs.staging }} installer: ${{ inputs.installer }} - msi_installer: false - pkg_installer: true + msi_installer: true secrets: inherit diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index e96f1ca781..aeae82e114 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -49,11 +49,6 @@ on: default: false required: true type: boolean - pkg_installer: - description: 'Create the pkg' - default: false - required: true - type: boolean env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} @@ -256,7 +251,7 @@ jobs: if "${{ runner.os }}" == "Windows": installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe" elif "${{ runner.os }}" == "macOS": - installer_ext = "pkg" if "${{ inputs.pkg_installer }}" == "true" else "dmg" + installer_ext = "pkg" if "${{ inputs.mis_installer }}" == "true" else "dmg" else: installer_ext = "AppImage" output_env = os.environ["GITHUB_OUTPUT"] From 116d2b9ce58dcf239f652f622048bc0f100ea985 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Thu, 12 Jan 2023 16:19:24 +0100 Subject: [PATCH 05/18] Add source path back to macOs installer for fetching dmg background image CURA-6867 --- .github/workflows/cura-installer.yml | 2 +- packaging/MacOS/build_macos.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index aeae82e114..dff7b70256 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -310,7 +310,7 @@ jobs: - name: Create the MacOS dmg and/or pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/MacOS/build_macos.py . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" + run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Upload the artifacts diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index ed2605594e..3dbb3652f5 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -140,6 +140,7 @@ def create_dmg(filename: str, dist_path: str, source_path: str) -> None: if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Create installer for Cura.") + parser.add_argument("source_path", type = str, help="Path to Pyinstaller source folder") parser.add_argument("dist_path", type = str, help="Path to Pyinstaller dist folder") parser.add_argument("filename", type = str, help = "Filename of the pkg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg')") args = parser.parse_args() From 0f683d301afea7a6cc67af8195021222b5a31a04 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 09:26:54 +0100 Subject: [PATCH 06/18] Remove double .dmg at the end of file name. Fix typo in msi_instaler CURA-6867 --- .github/workflows/cura-installer.yml | 2 +- packaging/MacOS/build_macos.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index dff7b70256..8a7cff58f6 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -251,7 +251,7 @@ jobs: if "${{ runner.os }}" == "Windows": installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe" elif "${{ runner.os }}" == "macOS": - installer_ext = "pkg" if "${{ inputs.mis_installer }}" == "true" else "dmg" + installer_ext = "pkg" if "${{ inputs.msi_installer }}" == "true" else "dmg" else: installer_ext = "AppImage" output_env = os.environ["GITHUB_OUTPUT"] diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index 3dbb3652f5..cc8ab0e2a4 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -129,13 +129,11 @@ def create_dmg(filename: str, dist_path: str, source_path: str) -> None: @param source_path: The location of the project source files """ - dmg_filename = f"{filename}.dmg" - - build_dmg(source_path, dist_path, dmg_filename) + build_dmg(source_path, dist_path, filename) notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE")) if notarize_dmg: - notarize_file(dist_path, dmg_filename) + notarize_file(dist_path, filename) if __name__ == "__main__": From 65bf56e9fadadee44322fefba242deffe01dacd0 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 10:18:33 +0100 Subject: [PATCH 07/18] Installer was replacing any previous cura version when installing. Casuing strange install locations. Now it will only replace cura version with the exact same CURA_CONAN_VERSION CURA-6867 --- .github/workflows/cura-installer.yml | 2 +- packaging/MacOS/build_macos.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index 8a7cff58f6..6f5b18e571 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -310,7 +310,7 @@ jobs: - name: Create the MacOS dmg and/or pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" + run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" working-directory: dist - name: Upload the artifacts diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index cc8ab0e2a4..ef239fa131 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -27,12 +27,13 @@ def build_dmg(source_path: str, dist_path: str, filename: str) -> None: subprocess.run(arguments) -def build_pkg(dist_path: str, app_filename: str, component_filename: str, installer_filename: str) -> None: +def build_pkg(dist_path: str, app_filename: str, component_filename: str, cura_version: str, installer_filename: str) -> None: """ Builds and signs the pkg installer. @param dist_path: Path to put output pkg in @param app_filename: name of the .app file to bundle inside the pkg @param component_filename: Name of the pkg component package to bundle the app in + @param cura_version: The version is used when automatically replacing existing versions with the installer. @param installer_filename: Name of the installer that contains the component package """ pkg_build_executable = os.environ.get("PKG_BUILD_EXECUTABLE", "pkgbuild") @@ -43,6 +44,7 @@ def build_pkg(dist_path: str, app_filename: str, component_filename: str, instal pkg_build_arguments = [ pkg_build_executable, "--identifier", ULTIMAKER_CURA_DOMAIN, + "--version", cura_version, "--component", Path(dist_path, app_filename), Path(dist_path, component_filename), @@ -99,7 +101,7 @@ def notarize_file(dist_path: str, filename: str) -> None: subprocess.run(notarize_arguments) -def create_pkg_installer(filename: str, dist_path: str) -> None: +def create_pkg_installer(filename: str, dist_path: str, cura_version: str) -> None: """ Creates a pkg installer from {filename}.app called {filename}-Installer.pkg The final package structure is UltiMaker-Cura-XXX-Installer.pkg[UltiMaker-Cura.pkg[UltiMaker-Cura.app]]. The outer @@ -114,7 +116,7 @@ def create_pkg_installer(filename: str, dist_path: str) -> None: cura_component_package_name = f"{filename_stem}-Component.pkg" # This is a component package that is nested inside the installer, it contains the UltiMaker-Cura.app file app_name = "UltiMaker-Cura.app" # This is the app file that will end up in your applications folder - build_pkg(dist_path, app_name, cura_component_package_name, filename) + build_pkg(dist_path, app_name, cura_component_package_name, cura_version, filename) notarize = bool(os.environ.get("NOTARIZE_INSTALLER", "FALSE")) if notarize: @@ -138,13 +140,14 @@ def create_dmg(filename: str, dist_path: str, source_path: str) -> None: if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Create installer for Cura.") - parser.add_argument("source_path", type = str, help="Path to Pyinstaller source folder") - parser.add_argument("dist_path", type = str, help="Path to Pyinstaller dist folder") + parser.add_argument("source_path", type = str, help = "Path to Pyinstaller source folder") + parser.add_argument("dist_path", type = str, help = "Path to Pyinstaller dist folder") + parser.add_argument("cura_version", type = str, help="The version of cura") parser.add_argument("filename", type = str, help = "Filename of the pkg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg')") args = parser.parse_args() if Path(args.filename).suffix == ".pkg": - create_pkg_installer(args.filename, args.dist_path) + create_pkg_installer(args.filename, args.dist_path, args.cura_version) elif Path(args.filename).suffix == ".dmg": create_dmg(args.filename, args.dist_path, args.source_path) else: From 6ca4af399a91df5a57c20b5f3d3784d30ddd6b91 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 11:33:43 +0100 Subject: [PATCH 08/18] Use different identifier for different versions so that they don't replace eachother. CURA-6867 --- packaging/MacOS/build_macos.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index ef239fa131..660ae596b4 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -43,8 +43,7 @@ def build_pkg(dist_path: str, app_filename: str, component_filename: str, cura_v # This builds the component package that contains UltiMaker-Cura.app. This component package will be bundled in a distribution package. pkg_build_arguments = [ pkg_build_executable, - "--identifier", ULTIMAKER_CURA_DOMAIN, - "--version", cura_version, + "--identifier", f"{ULTIMAKER_CURA_DOMAIN}_{cura_version}", # If we want to replace previous version automatecially remove {cure_version} "--component", Path(dist_path, app_filename), Path(dist_path, component_filename), From c04cc7809a7e1d6825cc5e1cc4b8dee6ce4b2833 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 13:38:10 +0100 Subject: [PATCH 09/18] Only use end of cura version for identifier. The "/" is an illegal character in the distribution.xml CURA-6867 --- packaging/MacOS/build_macos.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index 660ae596b4..3f2886d6d4 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -141,12 +141,14 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description = "Create installer for Cura.") parser.add_argument("source_path", type = str, help = "Path to Pyinstaller source folder") parser.add_argument("dist_path", type = str, help = "Path to Pyinstaller dist folder") - parser.add_argument("cura_version", type = str, help="The version of cura") + parser.add_argument("cura_conan_version", type = str, help="The version of cura") parser.add_argument("filename", type = str, help = "Filename of the pkg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg')") args = parser.parse_args() + cura_version = args.cura_conan_version.split("/")[-1] + if Path(args.filename).suffix == ".pkg": - create_pkg_installer(args.filename, args.dist_path, args.cura_version) + create_pkg_installer(args.filename, args.dist_path, cura_version) elif Path(args.filename).suffix == ".dmg": create_dmg(args.filename, args.dist_path, args.source_path) else: From 5b8ef526fb11d16a3d48dad91d5e9401302bae0b Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 15:45:27 +0100 Subject: [PATCH 10/18] =?UTF-8?q?Use=20bundle=20identifier=20including=20v?= =?UTF-8?q?ersion.=20This=20stops=20the=20installer=20from=20overwriting?= =?UTF-8?q?=20previous=20installs.=20This=20is=20circumventing=20the=20int?= =?UTF-8?q?ent=20of=20the=20pkg,=20it=20should=20always=20upgrade/update?= =?UTF-8?q?=20never=20double=20install.=20It=20will=20work=20though=20?= =?UTF-8?q?=F0=9F=A4=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CURA-6867 --- UltiMaker-Cura.spec.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiMaker-Cura.spec.jinja b/UltiMaker-Cura.spec.jinja index 23ac916c42..4251a5c461 100644 --- a/UltiMaker-Cura.spec.jinja +++ b/UltiMaker-Cura.spec.jinja @@ -255,7 +255,7 @@ app = UMBUNDLE( coll, name='{{ display_name }}.app'.replace(" ", "-"), icon={{ icon }}, - bundle_identifier={{ osx_bundle_identifier }}, + bundle_identifier={{ osx_bundle_identifier }} + _ + {{ version }}, version={{ version }}, info_plist={ 'CFBundleDisplayName': '{{ display_name }}', From b72e29f33ba1058d077aa6b24e403b4c75a6935c Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 16:11:45 +0100 Subject: [PATCH 11/18] typo CURA-6867 --- UltiMaker-Cura.spec.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiMaker-Cura.spec.jinja b/UltiMaker-Cura.spec.jinja index 4251a5c461..88a00f2080 100644 --- a/UltiMaker-Cura.spec.jinja +++ b/UltiMaker-Cura.spec.jinja @@ -255,7 +255,7 @@ app = UMBUNDLE( coll, name='{{ display_name }}.app'.replace(" ", "-"), icon={{ icon }}, - bundle_identifier={{ osx_bundle_identifier }} + _ + {{ version }}, + bundle_identifier={{ osx_bundle_identifier }} + "_" + {{ short_version }}, version={{ version }}, info_plist={ 'CFBundleDisplayName': '{{ display_name }}', From 7e88e3a0192199fee90ec377dd6caf4773983b82 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Fri, 13 Jan 2023 17:31:23 +0100 Subject: [PATCH 12/18] Addd display name to bundle identifier as well so that enterprise can be installed alongside normal Cura. CURA-6867 --- UltiMaker-Cura.spec.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiMaker-Cura.spec.jinja b/UltiMaker-Cura.spec.jinja index 88a00f2080..af5bd42003 100644 --- a/UltiMaker-Cura.spec.jinja +++ b/UltiMaker-Cura.spec.jinja @@ -255,7 +255,7 @@ app = UMBUNDLE( coll, name='{{ display_name }}.app'.replace(" ", "-"), icon={{ icon }}, - bundle_identifier={{ osx_bundle_identifier }} + "_" + {{ short_version }}, + bundle_identifier={{ osx_bundle_identifier }} + "_" + '{{ display_name }}'.replace(" ", "_") + "_" {{ short_version }}, version={{ version }}, info_plist={ 'CFBundleDisplayName': '{{ display_name }}', From 1554f5051881d10e4013221f116a96c2a5114bbb Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 10:20:06 +0100 Subject: [PATCH 13/18] Use app name so that enterprise is in the name CURA-6867 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 9a2c1773ed..7dd3c9db9b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -241,7 +241,7 @@ class CuraConan(ConanFile): with open(Path(location, "UltiMaker-Cura.spec"), "w") as f: f.write(pyinstaller.render( name = str(self.options.display_name).replace(" ", "-"), - display_name = self.options.display_name, + display_name = self._app_name, entrypoint = entrypoint_location, datas = datas, binaries = binaries, From cf4752aa0bead1a174e633cdeee74d55c3476068 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 10:21:04 +0100 Subject: [PATCH 14/18] Mention dmg in arg parser. Fix spelling CURA-6867 --- packaging/MacOS/build_macos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index 3f2886d6d4..683db96606 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -43,7 +43,7 @@ def build_pkg(dist_path: str, app_filename: str, component_filename: str, cura_v # This builds the component package that contains UltiMaker-Cura.app. This component package will be bundled in a distribution package. pkg_build_arguments = [ pkg_build_executable, - "--identifier", f"{ULTIMAKER_CURA_DOMAIN}_{cura_version}", # If we want to replace previous version automatecially remove {cure_version} + "--identifier", f"{ULTIMAKER_CURA_DOMAIN}_{cura_version}", # If we want to replace previous version automatically remove {cure_version} "--component", Path(dist_path, app_filename), Path(dist_path, component_filename), @@ -142,7 +142,7 @@ if __name__ == "__main__": parser.add_argument("source_path", type = str, help = "Path to Pyinstaller source folder") parser.add_argument("dist_path", type = str, help = "Path to Pyinstaller dist folder") parser.add_argument("cura_conan_version", type = str, help="The version of cura") - parser.add_argument("filename", type = str, help = "Filename of the pkg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg')") + parser.add_argument("filename", type = str, help = "Filename of the pkg/dmg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg' or 'UltiMaker-Cura-5.1.0-beta-Macos-X64.dmg')") args = parser.parse_args() cura_version = args.cura_conan_version.split("/")[-1] From 763dde61c8525d4c509598a467176217fa140242 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 10:21:24 +0100 Subject: [PATCH 15/18] Add comment to deprecate CURA-6867 --- .github/workflows/cura-installer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index 6f5b18e571..a2bf8c1ee2 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -120,7 +120,7 @@ jobs: - name: Install MacOS system requirements if: ${{ runner.os == 'Macos' }} - run: brew install autoconf automake ninja create-dmg + run: brew install autoconf automake ninja create-dmg # Delete create-dmg when deprecating dmg - name: Install Linux system requirements if: ${{ runner.os == 'Linux' }} From 902f4ef02e652a3611667c939972753e3dc961fc Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 10:22:06 +0100 Subject: [PATCH 16/18] Update packaging/MacOS/build_macos.py Co-authored-by: Jelle Spijker --- packaging/MacOS/build_macos.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index 3f2886d6d4..5d2d5f6aed 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -149,7 +149,5 @@ if __name__ == "__main__": if Path(args.filename).suffix == ".pkg": create_pkg_installer(args.filename, args.dist_path, cura_version) - elif Path(args.filename).suffix == ".dmg": - create_dmg(args.filename, args.dist_path, args.source_path) else: create_dmg(args.filename, args.dist_path, args.source_path) From e834cce32a6dcf75cbe7510b790e0aa7c955cd3f Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 15:29:38 +0100 Subject: [PATCH 17/18] Pass the app name into the build_macos script so that it matches the app name used in UltiMaker-Cura.spec.jinja --- .github/workflows/cura-installer.yml | 2 +- UltiMaker-Cura.spec.jinja | 2 +- packaging/MacOS/build_macos.py | 22 ++++++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index a2bf8c1ee2..e5c6c024fc 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -310,7 +310,7 @@ jobs: - name: Create the MacOS dmg and/or pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" + run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" $CURA_APP_NAME working-directory: dist - name: Upload the artifacts diff --git a/UltiMaker-Cura.spec.jinja b/UltiMaker-Cura.spec.jinja index af5bd42003..3d540d3b8f 100644 --- a/UltiMaker-Cura.spec.jinja +++ b/UltiMaker-Cura.spec.jinja @@ -253,7 +253,7 @@ class UMBUNDLE(BUNDLE): app = UMBUNDLE( coll, - name='{{ display_name }}.app'.replace(" ", "-"), + name='{{ display_name }}.app', icon={{ icon }}, bundle_identifier={{ osx_bundle_identifier }} + "_" + '{{ display_name }}'.replace(" ", "_") + "_" {{ short_version }}, version={{ version }}, diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index bbd2ad1a44..dcde629900 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -9,7 +9,7 @@ from pathlib import Path ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura") -def build_dmg(source_path: str, dist_path: str, filename: str) -> None: +def build_dmg(source_path: str, dist_path: str, filename: str, app_name: str) -> None: create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg") arguments = [create_dmg_executable, @@ -18,11 +18,11 @@ def build_dmg(source_path: str, dist_path: str, filename: str) -> None: "--app-drop-link", "520", "272", "--volicon", f"{source_path}/packaging/icons/VolumeIcons_Cura.icns", "--icon-size", "90", - "--icon", "UltiMaker-Cura.app", "169", "272", + "--icon", app_name, "169", "272", "--eula", f"{source_path}/packaging/cura_license.txt", "--background", f"{source_path}/packaging/MacOs/cura_background_dmg.png", f"{dist_path}/{filename}", - f"{dist_path}/UltiMaker-Cura.app"] + f"{dist_path}/{app_name}"] subprocess.run(arguments) @@ -100,7 +100,7 @@ def notarize_file(dist_path: str, filename: str) -> None: subprocess.run(notarize_arguments) -def create_pkg_installer(filename: str, dist_path: str, cura_version: str) -> None: +def create_pkg_installer(filename: str, dist_path: str, cura_version: str, app_name: str) -> None: """ Creates a pkg installer from {filename}.app called {filename}-Installer.pkg The final package structure is UltiMaker-Cura-XXX-Installer.pkg[UltiMaker-Cura.pkg[UltiMaker-Cura.app]]. The outer @@ -112,8 +112,7 @@ def create_pkg_installer(filename: str, dist_path: str, cura_version: str) -> N """ filename_stem = Path(filename).stem - cura_component_package_name = f"{filename_stem}-Component.pkg" # This is a component package that is nested inside the installer, it contains the UltiMaker-Cura.app file - app_name = "UltiMaker-Cura.app" # This is the app file that will end up in your applications folder + cura_component_package_name = f"{filename_stem}-Component.pkg" # This is a component package that is nested inside the installer, it contains the UltiMaker-Cura.app file This is the app file that will end up in your applications folder build_pkg(dist_path, app_name, cura_component_package_name, cura_version, filename) @@ -122,7 +121,7 @@ def create_pkg_installer(filename: str, dist_path: str, cura_version: str) -> N notarize_file(dist_path, filename) -def create_dmg(filename: str, dist_path: str, source_path: str) -> None: +def create_dmg(filename: str, dist_path: str, source_path: str, app_name: str) -> None: """ Creates a dmg executable from UltiMaker-Cura.app named {filename}.dmg @param filename: The name of the app file and the output dmg file without the extension @@ -130,7 +129,7 @@ def create_dmg(filename: str, dist_path: str, source_path: str) -> None: @param source_path: The location of the project source files """ - build_dmg(source_path, dist_path, filename) + build_dmg(source_path, dist_path, filename, app_name) notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE")) if notarize_dmg: @@ -143,11 +142,14 @@ if __name__ == "__main__": parser.add_argument("dist_path", type = str, help = "Path to Pyinstaller dist folder") parser.add_argument("cura_conan_version", type = str, help="The version of cura") parser.add_argument("filename", type = str, help = "Filename of the pkg/dmg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg' or 'UltiMaker-Cura-5.1.0-beta-Macos-X64.dmg')") + parser.add_argument("app_name", type = str, help = "Filename of the .app that will be contained within the dmg/pkg") args = parser.parse_args() cura_version = args.cura_conan_version.split("/")[-1] + app_name = f"{args.app_name}.app" + if Path(args.filename).suffix == ".pkg": - create_pkg_installer(args.filename, args.dist_path, cura_version) + create_pkg_installer(args.filename, args.dist_path, cura_version, app_name) else: - create_dmg(args.filename, args.dist_path, args.source_path) + create_dmg(args.filename, args.dist_path, args.source_path, app_name) From c0b120b2fd962be44fd79242e8762e77545d4595 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Mon, 16 Jan 2023 15:58:34 +0100 Subject: [PATCH 18/18] Put app name in quotes because it has spaces in it. CURA-9814 --- .github/workflows/cura-installer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index e5c6c024fc..56c885e0c5 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -310,7 +310,7 @@ jobs: - name: Create the MacOS dmg and/or pkg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" $CURA_APP_NAME + run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" "$CURA_APP_NAME" working-directory: dist - name: Upload the artifacts