diff --git a/PDFWriter.xcodeproj/project.pbxproj b/PDFWriter.xcodeproj/project.pbxproj index 4ca2b2e..3c8c438 100644 --- a/PDFWriter.xcodeproj/project.pbxproj +++ b/PDFWriter.xcodeproj/project.pbxproj @@ -330,11 +330,13 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "PDFWriter Utility/PDFWriter_Utility.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"PDFWriter Utility/Preview Content\""; - DEVELOPMENT_TEAM = H2LX99GBPZ; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = H2LX99GBPZ; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -345,7 +347,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = "au.rwts.PDFWriter-Utility"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -361,11 +363,13 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "PDFWriter Utility/PDFWriter_Utility.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"PDFWriter Utility/Preview Content\""; - DEVELOPMENT_TEAM = H2LX99GBPZ; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = H2LX99GBPZ; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -376,10 +380,11 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = "au.rwts.PDFWriter-Utility"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; @@ -388,9 +393,11 @@ 5506A7DB285FE2BC00C5BDF5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = H2LX99GBPZ; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = H2LX99GBPZ; ENABLE_HARDENED_RUNTIME = YES; INSTALL_PATH = /; MACOSX_DEPLOYMENT_TARGET = 11.0; @@ -403,9 +410,11 @@ 5506A7DC285FE2BC00C5BDF5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = H2LX99GBPZ; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = H2LX99GBPZ; ENABLE_HARDENED_RUNTIME = YES; INSTALL_PATH = /; MACOSX_DEPLOYMENT_TARGET = 11.0; diff --git a/README.md b/README.md index 0000887..e5b8b9b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ An OSX print to pdf-file printer driver -### [![](https://raw.githubusercontent.com/rodyager/RWTS-PDFwriter/master/build/PDFwriter.iconset/icon_256x256.png "Click to download installer pkg") Click to download the installer pkg](https://github.com/rodyager/RWTS-PDFwriter/releases/download/v2.0.3/RWTS-PDFwriter.pkg) +### [![](https://raw.githubusercontent.com/rodyager/RWTS-PDFwriter/master/build/PDFwriter.iconset/icon_256x256.png "Click to download installer pkg") Click to download the installer pkg](https://github.com/rodyager/RWTS-PDFwriter/releases/download/v2.0.4/RWTS-PDFwriter.pkg) ## About RWTS PDFwriter **RWTS PDFwriter** is an OSX 11.0+ compatible print driver that enables you to “print” your documents directly to a pdf file. It has similar functionality to [CutePDF](http://www.cutepdf.com) on Windows. @@ -30,16 +30,12 @@ If you want to uninstall **PDFwriter**, open the **PDFWriter Utility** (see abov ## Compiling from sources In the event that you want to compile your own copy, you can clone this repository. -Use XCode to archive the **PDFWriter Utility** target. In XCode's organizer, choose to distribute the **PDFWriter Utility** with Developer ID, and export the Notarized app to the build folder. - -Use XCode to archive the **pdfwriter** target. In XCode's organizer, choose to distribute **pdfwriter** as Built Products and copy the binary into the build folder. - -If anyone can contribute additions to the buildcript to automate the previous two steps, it would be appreciated. - -The signed and notarized product installer can then be compiled by executing the script +A signed and notarized product installer can be compiled by executing the script ` build/buildscript.sh -s "" -n "" ` +Omit the -n if you do not wish to notarize the components, and omit the -s if you do not want to sign the components. + You can create a "Keychain Profile" by generating an app-specific password at https://appleid.apple.com then executing ` xcrun altool --username "" --password "" --list-providers ` diff --git a/build/buildscript.sh b/build/buildscript.sh index b823e1f..78b8ec6 100755 --- a/build/buildscript.sh +++ b/build/buildscript.sh @@ -13,6 +13,7 @@ PDFWRITERDIR="pkgroot/Library/Printers/RWTS/PDFwriter" UTILITIESDIR="pkgroot/Library/Printers/RWTS/Utilities" PPDDIR="pkgroot/Library/Printers/PPDs/Contents/Resources" UTILITYAPP="PDFWriter Utility.app" +UTILITYZIP="PDFWriter Utility.zip" PPDFILE="RWTS PDFwriter" while getopts "s:n:" opt; do @@ -30,7 +31,31 @@ while getopts "s:n:" opt; do esac done + + cd "$(dirname "$0")" + +cd ../ +echo "### building Utility and printer driver" +xcodebuild -alltargets archive + +cd build + +echo "### copying binaries from tempory build folder" +cp -r "Release/$UTILITYAPP" ./ +cp -r "Release/pdfwriter" ./ + +if [ ! -z "$SIGNSTRING" ]; then echo "#### notarizing Utility"; + ditto -c -k --keepParent "$UTILITYAPP" "$UTILITYZIP"; + xcrun notarytool submit "$UTILITYZIP" --keychain-profile "$NOTARYSTRING" --wait; + xcrun stapler staple "$UTILITYAPP;" + rm "$UTILITYZIP"; +fi + +echo "### clean up build artefacts" + +rm -r EagerLinkingTBDs PDFWriter.build Release XCBuildData + echo "#### making directory structure" mkdir pkgroot resources scripts mkdir -m 775 pkgroot/Library pkgroot/Library/Printers pkgroot/Library/Printers/RWTS @@ -74,10 +99,10 @@ pkgutil --expand product.pkg expanded cp -r README.rtfd expanded/Resources/ pkgutil --flatten expanded RWTS-PDFwriter.pkg -if [ $SIGNSTRING ]; then echo "#### signing product"; - productsign --sign $SIGNSTRING RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg > /dev/null; - if [ $NOTARYSTRING ]; then echo "#### notarizing product"; - xcrun notarytool submit ../RWTS-PDFwriter.pkg --keychain-profile $NOTARYSTRING --wait; +if [ ! -z "$SIGNSTRING" ]; then echo "#### signing product"; + productsign --sign "$SIGNSTRING" RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg > /dev/null; + if [ ! -z "$NOTARYSTRING" ]; then echo "#### notarizing product"; + xcrun notarytool submit ../RWTS-PDFwriter.pkg --keychain-profile "$NOTARYSTRING" --wait; xcrun stapler staple ../RWTS-PDFwriter.pkg; fi else mv RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg; fi diff --git a/build/postinstall b/build/postinstall index 2ce757f..3fd8a43 100755 --- a/build/postinstall +++ b/build/postinstall @@ -21,8 +21,10 @@ launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist # install printer lpadmin -p PDFwriter -E -v pdfwriter:/ -P /Library/Printers/PPDs/Contents/Resources/RWTS\ PDFwriter.gz -o printer-is-shared=false +# don't launch Utility if CLI install + [ "$COMMAND_LINE_INSTALL" == "1" ] && exit 0 + # open the Utility with correct environment uid=$(id -u "$USER") -if [ $uid -ne 0 ]; then - launchctl asuser $uid su "$USER" -c "/Library/Printers/RWTS/Utilities/PDFWriter\ Utility.app/Contents/MacOS/PDFWriter\ Utility" -fi +launchctl asuser $uid sudo -u "$USER" open -b au.rwts.PDFWriter-Utility + diff --git a/pdfwriter/pdfwriter.h b/pdfwriter/pdfwriter.h index 923fbb5..f70f6f6 100644 --- a/pdfwriter/pdfwriter.h +++ b/pdfwriter/pdfwriter.h @@ -28,7 +28,7 @@ -#define VERSION "2.0.3" +#define VERSION "2.0.4" #define CPERROR 1 #define CPSTATUS 2