mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-15 06:52:34 +02:00
WIP: Add mac .dmg installer
This does not yet work with signing of the macos .dmg ScreenPlay-Installer.dmg: rejected (the code is valid but does not seem to be an app)
This commit is contained in:
parent
716db7ac66
commit
fdbf077f0e
22
CMake/CreateDmgInstaller.cmake
Normal file
22
CMake/CreateDmgInstaller.cmake
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
message(STATUS "[DMG INSTALLER ENABLED]: Configuring. This can take some time...")
|
||||||
|
|
||||||
|
set(CPACK_GENERATOR "DragNDrop")
|
||||||
|
set(CPACK_DMG_FORMAT "UDBZ")
|
||||||
|
set(CPACK_DMG_VOLUME_NAME "ScreenPlay")
|
||||||
|
set(CPACK_SYSTEM_NAME "OSX")
|
||||||
|
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/ScreenPlay/assets/icons/app.ico")
|
||||||
|
|
||||||
|
set(CPACK_COMPONENTS_GROUPING IGNORE)
|
||||||
|
set(CPACK_PACKAGE_NAME "ScreenPlay")
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "ScreenPlay-Installer")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "Elias Steurer")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
|
||||||
|
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
|
# Install all files from /bin
|
||||||
|
install(
|
||||||
|
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
|
||||||
|
COMPONENT ScreenPlay
|
||||||
|
DESTINATION "./")
|
@ -135,8 +135,12 @@ if(WIN32)
|
|||||||
add_subdirectory(ScreenPlaySysInfo)
|
add_subdirectory(ScreenPlaySysInfo)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SCREENPLAY_INSTALLER} AND NOT APPLE)
|
if(${SCREENPLAY_INSTALLER})
|
||||||
|
if(APPLE)
|
||||||
|
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CreateDmgInstaller.cmake)
|
||||||
|
else()
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CreateIFWInstaller.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CreateIFWInstaller.cmake)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "[PROJECT] PROJECT_VERSION = ${PROJECT_VERSION}")
|
message(STATUS "[PROJECT] PROJECT_VERSION = ${PROJECT_VERSION}")
|
||||||
|
@ -104,6 +104,11 @@ def execute(
|
|||||||
package_duration = time.time() - step_time
|
package_duration = time.time() - step_time
|
||||||
print(f"⏱️ package_duration: {package_duration}s")
|
print(f"⏱️ package_duration: {package_duration}s")
|
||||||
|
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
if (build_config.sign_osx):
|
||||||
|
print(f"Sign binary at: {build_config.bin_dir}")
|
||||||
|
macos_sign.sign(build_config=build_config)
|
||||||
|
|
||||||
# Creates a Qt InstallerFrameWork (IFW) installer
|
# Creates a Qt InstallerFrameWork (IFW) installer
|
||||||
if build_config.create_installer == "ON":
|
if build_config.create_installer == "ON":
|
||||||
step_time = time.time()
|
step_time = time.time()
|
||||||
@ -111,7 +116,13 @@ def execute(
|
|||||||
build_installer_duration = time.time() - step_time
|
build_installer_duration = time.time() - step_time
|
||||||
print(f"⏱️ build_installer_duration: {build_installer_duration}s")
|
print(f"⏱️ build_installer_duration: {build_installer_duration}s")
|
||||||
|
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
if (build_config.sign_osx):
|
||||||
|
print(f"Sign ScreenPlay-installer.dmg at: {build_config.bin_dir}")
|
||||||
|
macos_sign.sign_dmg(build_config=build_config)
|
||||||
|
|
||||||
# Create a zip file of the build
|
# Create a zip file of the build
|
||||||
|
if platform.system() != "Darwin":
|
||||||
step_time = time.time()
|
step_time = time.time()
|
||||||
build_result = zip(build_config, build_result)
|
build_result = zip(build_config, build_result)
|
||||||
zip_duration = time.time() - step_time
|
zip_duration = time.time() - step_time
|
||||||
@ -247,10 +258,6 @@ def package(build_config: BuildConfig):
|
|||||||
run(cmd=cmd_raw.format(qt_bin_path=qt_bin_path, repo_root_path=source_path,
|
run(cmd=cmd_raw.format(qt_bin_path=qt_bin_path, repo_root_path=source_path,
|
||||||
build_bin_dir=build_bin_dir, app="ScreenPlayWidget"), cwd=cwd)
|
build_bin_dir=build_bin_dir, app="ScreenPlayWidget"), cwd=cwd)
|
||||||
|
|
||||||
if (build_config.sign_osx):
|
|
||||||
print(f"Sign binary at: {build_config.bin_dir}")
|
|
||||||
macos_sign.sign(build_config=build_config)
|
|
||||||
|
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
print("Executing deploy commands...")
|
print("Executing deploy commands...")
|
||||||
run(build_config.package_command.format(
|
run(build_config.package_command.format(
|
||||||
|
@ -7,6 +7,7 @@ import time
|
|||||||
|
|
||||||
stdout.reconfigure(encoding='utf-8')
|
stdout.reconfigure(encoding='utf-8')
|
||||||
|
|
||||||
|
|
||||||
def sign(build_config: BuildConfig):
|
def sign(build_config: BuildConfig):
|
||||||
print("Run codedesign")
|
print("Run codedesign")
|
||||||
#run("codesign -f -s 'Developer ID Application: Elias Steurer (V887LHYKRH)' --verbose --force --timestamp --options 'runtime' -f --entitlements '../../ScreenPlay/entitlements.plist' 'ScreenPlay.app/' ",
|
#run("codesign -f -s 'Developer ID Application: Elias Steurer (V887LHYKRH)' --verbose --force --timestamp --options 'runtime' -f --entitlements '../../ScreenPlay/entitlements.plist' 'ScreenPlay.app/' ",
|
||||||
@ -18,6 +19,7 @@ def sign(build_config: BuildConfig):
|
|||||||
run("codesign --deep -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --verbose --force --timestamp --options \"runtime\" --entitlements \"../../ScreenPlay/entitlements.plist\" \"ScreenPlay.app/\"",
|
run("codesign --deep -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --verbose --force --timestamp --options \"runtime\" --entitlements \"../../ScreenPlay/entitlements.plist\" \"ScreenPlay.app/\"",
|
||||||
cwd=build_config.bin_dir)
|
cwd=build_config.bin_dir)
|
||||||
|
|
||||||
|
|
||||||
print("Run codedesign verify")
|
print("Run codedesign verify")
|
||||||
run("codesign --verify --verbose=4 'ScreenPlay.app/'",
|
run("codesign --verify --verbose=4 'ScreenPlay.app/'",
|
||||||
cwd=build_config.bin_dir)
|
cwd=build_config.bin_dir)
|
||||||
@ -41,25 +43,27 @@ def sign(build_config: BuildConfig):
|
|||||||
print("Run spctl assess")
|
print("Run spctl assess")
|
||||||
run("spctl --assess --verbose 'ScreenPlay.app/'", cwd=build_config.bin_dir)
|
run("spctl --assess --verbose 'ScreenPlay.app/'", cwd=build_config.bin_dir)
|
||||||
|
|
||||||
print("Remove *.app.zip files.")
|
print("Remove ScreenPlay.app.zip.")
|
||||||
run("rm ScreenPlay.app.zip", cwd=build_config.bin_dir)
|
run("rm ScreenPlay.app.zip", cwd=build_config.bin_dir)
|
||||||
|
|
||||||
|
def sign_dmg(build_config: BuildConfig):
|
||||||
|
# Sign the DMG
|
||||||
|
run("codesign -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlay-Installer.dmg\"", cwd=build_config.build_folder)
|
||||||
|
|
||||||
# We also need to sign the installer in osx:
|
# Verify the DMG's signature
|
||||||
if build_config.create_installer == "ON":
|
run("codesign --verify --verbose=4 \"ScreenPlay-Installer.dmg\"", cwd=build_config.build_folder)
|
||||||
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlay-Installer.dmg/ScreenPlay-Installer.app/Contents/MacOS/ScreenPlay-Installer\"", cwd=build_config.build_folder)
|
|
||||||
run("codesign --verify --verbose=4 \"ScreenPlay-Installer.dmg/ScreenPlay-Installer.app/Contents/MacOS/ScreenPlay-Installer\"",
|
|
||||||
cwd=build_config.build_folder)
|
|
||||||
run("xcnotary notarize ScreenPlay-Installer.dmg/ScreenPlay-Installer.app -d kelteseth@gmail.com -k ScreenPlay",
|
|
||||||
cwd=build_config.build_folder)
|
|
||||||
run("spctl --assess --verbose \"ScreenPlay-Installer.dmg/ScreenPlay-Installer.app/\"",
|
|
||||||
cwd=build_config.build_folder)
|
|
||||||
|
|
||||||
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlay-Installer.dmg/\"", cwd=build_config.build_folder)
|
# Pack the DMG for notarization
|
||||||
run("codesign --verify --verbose=4 \"ScreenPlay-Installer.dmg/\"",
|
run("ditto -c -k --keepParent ScreenPlay-Installer.dmg ScreenPlay-Installer.dmg.zip", cwd=build_config.build_folder)
|
||||||
cwd=build_config.build_folder)
|
|
||||||
run("xcnotary notarize ScreenPlay-Installer.dmg -d kelteseth@gmail.com -k ScreenPlay",
|
|
||||||
cwd=build_config.build_folder)
|
|
||||||
run("spctl --assess --verbose \"ScreenPlay-Installer.dmg/\"",
|
|
||||||
cwd=build_config.build_folder)
|
|
||||||
|
|
||||||
|
# Notarize the DMG using notarytool
|
||||||
|
run("xcrun notarytool submit ScreenPlay-Installer.dmg.zip --keychain-profile 'ScreenPlay' --wait", cwd=build_config.build_folder)
|
||||||
|
|
||||||
|
# Staple the notarization ticket to the DMG
|
||||||
|
run("xcrun stapler staple ScreenPlay-Installer.dmg", cwd=build_config.build_folder)
|
||||||
|
|
||||||
|
# Check the notarization status for the DMG
|
||||||
|
run("spctl --assess --verbose \"ScreenPlay-Installer.dmg\"", cwd=build_config.build_folder)
|
||||||
|
|
||||||
|
# Clean up the zip file
|
||||||
|
run("rm ScreenPlay-Installer.dmg.zip", cwd=build_config.build_folder)
|
||||||
|
Loading…
Reference in New Issue
Block a user