Apple Sign Using BinPath (#144)

Co-authored-by: Chris Rizzitello <crizzitello@ics.com>
main
crizzitello 2022-04-29 14:34:24 -04:00 committed by GitHub
parent 076ceccdfc
commit a0165a015f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -19,15 +19,12 @@ if(NOT CPACK_PACKAGE_VERSION)
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
endif()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
if(QT_DEFAULT_MAJOR_VERSION MATCHES "5")
STRING(APPEND CPACK_PACKAGE_FILE_NAME "-Qt5")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CPACK_PACKAGE_VENDOR "Yahoo")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ashirt")
set(CPACK_NSIS_DISPLAY_NAME ${CMAKE_PACKAGE_NAME})
set(CPACK_NSIS_COMPRESSOR lzma)
set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/deploy/ashirt.ico")
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/ashirt.ico")
set(CPACK_NSIS_INSTALLED_ICON_NAME ashirt.exe)
set(CPACK_NSIS_MENU_LINKS "ashirt.exe" "ashirt")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
@ -41,10 +38,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CPACK_GENERATOR "NSIS")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# Write our cert identifier to a file generate_ds_store.applescript can read
file(WRITE ${PROJECT_SOURCE_DIR}/deploy/NOTARIZE_AS ${NOTARIZE_AS})
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/deploy/dmg_icon.icns")
set(CPACK_DMG_BACKGROUND_IMAGE "${PROJECT_SOURCE_DIR}/deploy/dmg_background.png")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${PROJECT_SOURCE_DIR}/deploy/generate_ds_store.applescript")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/deploy/NOTARIZE_AS ${NOTARIZE_AS})
configure_file(generate_ds_store.applescript.in ${CMAKE_CURRENT_BINARY_DIR}/generate_ds_store.applescript @ONLY)
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/dmg_icon.icns")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/dmg_background.png")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/generate_ds_store.applescript")
set(CPACK_DMG_VOLUME_NAME "ashirt")
set(CPACK_GENERATOR "DragNDrop")
endif()

View File

@ -43,7 +43,7 @@ on run argv
set position of item "README.MD" to { 250, 0 }
set position of item "Applications" to { 500, 225 }
try
do shell script "codesign -v -f --timestamp --options runtime --sign \"$(cat deploy/NOTARIZE_AS)\" /Volumes/" & image_name & "/ashirt.app/Contents/MacOS/ashirt"
do shell script "codesign -v -f --timestamp --options runtime --sign \"$(cat @CMAKE_CURRENT_BINARY_DIR@/NOTARIZE_AS)\" /Volumes/" & image_name & "/ashirt.app/Contents/MacOS/ashirt"
end try
end tell
delay 5