diff --git a/.gitignore b/.gitignore index b15a50452..cceb7dd93 100755 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,10 @@ /ext/llvm-g++-Xcode4.6.2 /ext/llvm-g++-Xcode4.6.2.tar.bz2 /zerotier-* -/ZeroTierUI/*.user *.o .DS_Store .Apple* *.dSYM -/netconf-service/node_modules /ipch /windows/ZeroTierOne.sdf /windows/ZeroTierOne.v11.suo @@ -33,7 +31,6 @@ /ZeroTierOneInstaller-* .qmake.stash *.autosave -/ZeroTier One.dmg /root-topology/bin2c /root-topology/mktopology /root-topology/*.secret diff --git a/buildinstaller.sh b/buildinstaller.sh index 5b45cb848..8f252dffe 100755 --- a/buildinstaller.sh +++ b/buildinstaller.sh @@ -120,33 +120,6 @@ case "$system" in ;; - Darwin) - echo "Assembling mac installer for x86/x64 (combined) version $vmajor.$vminor.$revision" - - mkdir -p 'build-installer/Applications' - cp -a 'build-ZeroTierUI-release/ZeroTier One.app' 'build-installer/Applications' - mkdir -p 'build-installer/Library/Application Support/ZeroTier/One' - cp -fp 'ext/installfiles/mac/uninstall.sh' 'build-installer/Library/Application Support/ZeroTier/One' - cp -fp 'ext/installfiles/mac/launch.sh' 'build-installer/Library/Application Support/ZeroTier/One' - cp -fp 'zerotier-one' 'build-installer/Library/Application Support/ZeroTier/One' - cp -fRp ext/bin/tap-mac/* 'build-installer/Library/Application Support/ZeroTier/One' - mkdir -p 'build-installer/Library/LaunchDaemons' - cp -fp 'ext/installfiles/mac/com.zerotier.one.plist' 'build-installer/Library/LaunchDaemons' - - targ="ZeroTierOneInstaller-mac-combined-${vmajor}_${vminor}_${revision}" - rm -f build-installer-tmp.tar.bz2 - cd build-installer - find . -type f -name .DS_Store -print0 | xargs -0 rm -f - tar -cf - * | bzip2 -9 >../build-installer-tmp.tar.bz2 - cd .. - rm -f $targ - cat ext/installfiles/mac/install.tmpl.sh build-installer-tmp.tar.bz2 >$targ - chmod 0755 $targ - rm -f build-installer-tmp.tar.bz2 - ls -l $targ - - ;; - *) echo "Unsupported platform: $system" exit 2 diff --git a/ext/installfiles/mac/ZeroTier One.pkgproj b/ext/installfiles/mac/ZeroTier One.pkgproj new file mode 100755 index 000000000..93dba7147 --- /dev/null +++ b/ext/installfiles/mac/ZeroTier One.pkgproj @@ -0,0 +1,984 @@ + + + + + PROJECT + + PACKAGE_FILES + + DEFAULT_INSTALL_LOCATION + / + HIERARCHY + + CHILDREN + + + CHILDREN + + + CHILDREN + + GID + 80 + PATH + Utilities + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 80 + PATH + /Users/api/Code/ZeroTierOne/ext/mac-ui-macgap1-wrapper/bin/ZeroTier One.app + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + GID + 80 + PATH + Applications + PATH_TYPE + 0 + PERMISSIONS + 509 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + + CHILDREN + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/get-proxy-settings.sh + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/launch.sh + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ext/bin/tap-mac/tap.kext + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/index.html + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/main.js + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/react.min.js + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/simpleajax.min.js + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/zerotier.css + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ui/ztui.min.js + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + GID + 0 + PATH + ui + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 2 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/uninstall.sh + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/zerotier-one + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + GID + 80 + PATH + One + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 2 + UID + 0 + + + GID + 80 + PATH + ZeroTier + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 2 + UID + 0 + + + GID + 80 + PATH + Application Support + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Automator + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Documentation + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Filesystems + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Frameworks + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Input Methods + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Internet Plug-Ins + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + LaunchAgents + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/com.zerotier.one.plist + PATH_TYPE + 0 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + GID + 0 + PATH + LaunchDaemons + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PreferencePanes + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Preferences + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 80 + PATH + Printers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PrivilegedHelperTools + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickLook + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickTime + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Screen Savers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Scripts + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Services + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Widgets + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + Library + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + Extensions + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + Library + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + System + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + Shared + PATH_TYPE + 0 + PERMISSIONS + 1023 + TYPE + 1 + UID + 0 + + + GID + 80 + PATH + Users + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + / + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + PAYLOAD_TYPE + 0 + VERSION + 3 + + PACKAGE_SCRIPTS + + POSTINSTALL_PATH + + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/postinst.sh + PATH_TYPE + 0 + + PREINSTALL_PATH + + PATH + /Users/api/Code/ZeroTierOne/ext/installfiles/mac/preinst.sh + PATH_TYPE + 0 + + RESOURCES + + + PACKAGE_SETTINGS + + AUTHENTICATION + 1 + CONCLUSION_ACTION + 0 + IDENTIFIER + com.zerotier.pkg.ZeroTierOne + OVERWRITE_PERMISSIONS + + VERSION + 1.0.3 + + PROJECT_COMMENTS + + NOTES + + PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M + IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv + c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l + cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7 + IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250 + ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp + dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u + dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD + b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjEzNDcuNTciPgo8c3R5bGUg + dHlwZT0idGV4dC9jc3MiPgpwLnAxIHttYXJnaW46IDAuMHB4IDAu + MHB4IDAuMHB4IDAuMHB4OyBmb250OiAxMi4wcHggSGVsdmV0aWNh + OyBjb2xvcjogIzAwMDAwMDsgLXdlYmtpdC10ZXh0LXN0cm9rZTog + IzAwMDAwMH0Kc3Bhbi5zMSB7Zm9udC1rZXJuaW5nOiBub25lfQo8 + L3N0eWxlPgo8L2hlYWQ+Cjxib2R5Pgo8cCBjbGFzcz0icDEiPjxz + cGFuIGNsYXNzPSJzMSI+WmVyb1RpZXIgT25lIC0gTmV0d29yayBW + aXJ0dWFsaXphdGlvbiBFdmVyeXdoZXJlPC9zcGFuPjwvcD4KPHAg + Y2xhc3M9InAxIj48c3BhbiBjbGFzcz0iczEiPihjKTIwMTEtMjAx + NSBaZXJvVGllciwgSW5jLjwvc3Bhbj48L3A+CjxwIGNsYXNzPSJw + MSI+PHNwYW4gY2xhc3M9InMxIj5jb250YWN0QHplcm90aWVyLmNv + bTwvc3Bhbj48L3A+CjxwIGNsYXNzPSJwMSI+PHNwYW4gY2xhc3M9 + InMxIj48YnI+Cjwvc3Bhbj48L3A+CjxwIGNsYXNzPSJwMSI+PHNw + YW4gY2xhc3M9InMxIj5UbyB1bmluc3RhbGwgbWFudWFsbHksIHR5 + cGUgdGhlIGZvbGxvd2luZyBpbiBhIHRlcm1pbmFsIHdpbmRvdzo8 + L3NwYW4+PC9wPgo8cCBjbGFzcz0icDEiPjxzcGFuIGNsYXNzPSJz + MSI+PGJyPgo8L3NwYW4+PC9wPgo8cCBjbGFzcz0icDEiPjxzcGFu + IGNsYXNzPSJzMSI+c3VkbyAiL0xpYnJhcnkvQXBwbGljYXRpb24g + U3VwcG9ydC9aZXJvVGllci9PbmUvdW5pbnN0YWxsLnNoIjwvc3Bh + bj48L3A+CjwvYm9keT4KPC9odG1sPgo= + + + PROJECT_SETTINGS + + BUILD_PATH + + PATH + ../../.. + PATH_TYPE + 1 + + EXCLUDED_FILES + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .DS_Store + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .DS_Store files + PROXY_TOOLTIP + Remove ".DS_Store" files created by the Finder. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .pbdevelopment + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .pbdevelopment files + PROXY_TOOLTIP + Remove ".pbdevelopment" files created by ProjectBuilder or Xcode. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + CVS + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .cvsignore + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .cvspass + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .svn + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .git + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .gitignore + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove SCM metadata + PROXY_TOOLTIP + Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + classes.nib + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + designable.db + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + info.nib + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Optimize nib files + PROXY_TOOLTIP + Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + Resources Disabled + TYPE + 1 + + + PROTECTED + + PROXY_NAME + Remove Resources Disabled folders + PROXY_TOOLTIP + Remove "Resources Disabled" folders. + STATE + + + + SEPARATOR + + + + NAME + ZeroTier One + + + TYPE + 1 + VERSION + 2 + + diff --git a/ext/installfiles/mac/install.tmpl.sh b/ext/installfiles/mac/install.tmpl.sh deleted file mode 100644 index d0c7efe1b..000000000 --- a/ext/installfiles/mac/install.tmpl.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/bash - -export PATH=/bin:/usr/bin:/sbin:/usr/sbin -shopt -s expand_aliases - -dryRun=0 - -echo "*** ZeroTier One install/update ***" - -if [ "$UID" -ne 0 ]; then - echo "Not running as root so doing dry run (no modifications to system)..." - dryRun=1 -fi - -if [ $dryRun -gt 0 ]; then - alias ln="echo '>> dry run: ln'" - alias rm="echo '>> dry run: rm'" - alias mv="echo '>> dry run: mv'" - alias cp="echo '>> dry run: cp'" - alias chown="echo '>> dry run: chown'" - alias chgrp="echo '>> dry run: chgrp'" - alias chmod="echo '>> dry run: chmod'" - alias launchctl="echo '>> dry run: launchctl'" - alias zerotier-cli="echo '>> dry run: zerotier-cli'" -fi - -zthome="/Library/Application Support/ZeroTier/One" -ztapp="/Applications/ZeroTier One.app" -if [ ! -d "$ztapp" ]; then - ztapp=`mdfind kMDItemCFBundleIdentifier == 'com.zerotier.ZeroTierOne' | grep -E '.*ZeroTier One[.]app$' | grep -v -F '/build-' | grep -v -F '/Volumes/ZeroTier' | sort | head -n 1` -fi - -scriptPath="`dirname "$0"`/`basename "$0"`" -if [ ! -r "$scriptPath" ]; then - scriptPath="$0" - if [ ! -r "$scriptPath" ]; then - echo "Installer cannot determine its own path; $scriptPath is not readable." - exit 2 - fi -fi - -endMarkerIndex=`grep -a -b -E '^################' "$scriptPath" | head -c 16 | cut -d : -f 1` -if [ "$endMarkerIndex" -le 100 ]; then - echo 'Internal error: unable to find end of script / start of binary data marker.' - exit 2 -fi -blobStart=`expr $endMarkerIndex + 17` -if [ "$blobStart" -le "$endMarkerIndex" ]; then - echo 'Internal error: unable to find end of script / start of binary data marker.' - exit 2 -fi - -echo 'Extracting files...' -if [ $dryRun -gt 0 ]; then - echo ">> dry run: tail -c +$blobStart \"$scriptPath\" | bunzip2 -c | tar -xvop -C / -f -" -else - rm -rf '/tmp/_zt1tmp' - mkdir '/tmp/_zt1tmp' - tail -c +$blobStart "$scriptPath" | bunzip2 -c | tar -xop -C '/tmp/_zt1tmp' -f - -fi - -cd '/tmp/_zt1tmp' - -if [ $dryRun -eq 0 -a ! -d './Applications/ZeroTier One.app' ]; then - echo 'Archive extraction failed, cannot find files in /tmp/_zt1tmp.' - exit 2 -fi - -echo 'Installing zerotier-one service...' - -mkdir -p "$zthome" -chown root:admin "$zthome" -chmod 0750 "$zthome" -cp -fa ./Library/Application\ Support/ZeroTier/One/* "$zthome" -chown -R root:wheel "$zthome/tap.kext" -chown -R root:wheel "$zthome/pre10.8/tap.kext" - -echo 'Installing/updating ZeroTier One.app...' - -if [ ! -z "$ztapp" -a -d "$ztapp" -a -f "$ztapp/Contents/Info.plist" ]; then - # Preserve ownership of current app across updates... that way the admin - # user who dragged it into /Applications can just trash it the way they - # would any other app. This works (due to mdfind up top) even if they put - # it somewhere non-standard on their system. - currentAppOwner=`stat -f '%u' "$ztapp"` - currentAppGroup=`stat -f '%g' "$ztapp"` - - rm -rf "$ztapp" - mv -f './Applications/ZeroTier One.app' "$ztapp" - - if [ ! -z "$currentAppOwner" -a ! -z "$currentAppGroup" ]; then - chown -R $currentAppOwner "$ztapp" - chgrp -R $currentAppGroup "$ztapp" - else - chown -R root "$ztapp" - chgrp -R admin "$ztapp" - fi -else - # If there is no existing app, just drop the shipped one into place - ztapp="/Applications/ZeroTier One.app" - mv -f './Applications/ZeroTier One.app' "$ztapp" - chown -R root "$ztapp" - chgrp -R admin "$ztapp" -fi - -# Set up symlink that watches for app deletion -rm -f "$zthome/shutdownIfUnreadable" -ln -sf "$ztapp/Contents/Info.plist" "$zthome/shutdownIfUnreadable" - -echo 'Installing zerotier-cli command line utility...' - -rm -f /usr/bin/zerotier-cli /usr/bin/zerotier-idtool -ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" /usr/bin/zerotier-cli -ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" /usr/bin/zerotier-idtool - -# This lets the install helper AppleScript thingy go ahead and authorize the -# user after the installer is done, skiping that step for the user who did -# the service install. -if [ ! -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then - echo 'Pre-creating authtoken.secret for ZeroTier service...' - if [ $dryRun -eq 0 ]; then - rm -f '/Library/Application Support/ZeroTier/One/authtoken.secret' - head -c 1024 /dev/urandom | md5 | head -c 24 >'/Library/Application Support/ZeroTier/One/authtoken.secret' - chmod 0600 '/Library/Application Support/ZeroTier/One/authtoken.secret' - fi -fi - -echo 'Installing and (re-)starting zerotier-one service via launchctl...' - -mv -f './Library/LaunchDaemons/com.zerotier.one.plist' '/Library/LaunchDaemons/' -launchctl load /Library/LaunchDaemons/com.zerotier.one.plist - -# launchctl will restart us after exit if this is an online auto-update - -cd /tmp -rm -rf _zt1tmp - -exit 0 - -# Do not remove the last line or add a carriage return to it! The installer -# looks for an unterminated line beginning with 16 #'s in itself to find -# the binary blob data, which is appended after it. - -################ \ No newline at end of file diff --git a/ext/installfiles/mac/postinst.sh b/ext/installfiles/mac/postinst.sh new file mode 100755 index 000000000..d41b733a4 --- /dev/null +++ b/ext/installfiles/mac/postinst.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +export PATH=/bin:/usr/bin:/sbin:/usr/sbin + +launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 +sleep 1 +killall zerotier-one +sleep 1 +killall -9 zerotier-one + +cd "/Library/Application Support/ZeroTier/One" +rm -rf node.log node.log.old root-topology shutdownIfUnreadable autoupdate.log updates.d +if [ ! -f authtoken.secret ]; then + head -c 1024 /dev/urandom | md5 | head -c 24 >authtoken.secret + chown root authtoken.secret + chgrp wheel authtoken.secret + chmod 0600 authtoken.secret +fi + +launchctl load /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 + +exit 0 diff --git a/ext/installfiles/mac/preinst.sh b/ext/installfiles/mac/preinst.sh new file mode 100755 index 000000000..9fa50bef2 --- /dev/null +++ b/ext/installfiles/mac/preinst.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +export PATH=/bin:/usr/bin:/sbin:/usr/sbin + +if [ -f /Library/LaunchDaemons/com.zerotier.one.plist ]; then + launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist >>/dev/null 2>&1 + sleep 1 + killall zerotier-one + sleep 1 + killall -9 zerotier-one +fi + +cd /Applications +rm -rf "ZeroTier One.app" diff --git a/make-mac.mk b/make-mac.mk index a52ee2d09..717cbccb3 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -56,29 +56,20 @@ one: $(OBJS) one.o $(STRIP) zerotier-one ln -sf zerotier-one zerotier-idtool ln -sf zerotier-one zerotier-cli + $(CODESIGN) -f -s $(CODESIGN_CERT) zerotier-one + $(CODESIGN) -vvv zerotier-one selftest: $(OBJS) selftest.o $(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS) $(STRIP) zerotier-selftest -# Requires that ../Qt be symlinked to the Qt root to use for UI build -#mac-ui: FORCE -# mkdir -p build-ZeroTierUI-release -# cd build-ZeroTierUI-release ; ../../Qt/bin/qmake ../ZeroTierUI/ZeroTierUI.pro ; make -j 4 -# strip "build-ZeroTierUI-release/ZeroTier One.app/Contents/MacOS/ZeroTier One" -# find "build-ZeroTierUI-release/ZeroTier One.app" -type f -name '.DS_Store' -print0 | xargs -0 rm -f -# $(CODESIGN) -f -s $(CODESIGN_CERT) "build-ZeroTierUI-release/ZeroTier One.app" -# $(CODESIGN) -vvv "build-ZeroTierUI-release/ZeroTier One.app" +sign-pkg: FORCE + $(CODESIGN) -f -s $(CODESIGN_CERT) "ZeroTier One.pkg" + $(CODESIGN) -vvv "ZeroTier One.pkg" clean: rm -rf *.dSYM build-* *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-* -# For our use -- builds official signed binary, packages in installer and download DMG -#official: FORCE -# make -j 4 ZT_OFFICIAL_RELEASE=1 -# ./buildinstaller.sh -# make mac-dmg ZT_OFFICIAL_RELEASE=1 - # For those building from source -- installs signed binary tap driver in system ZT home install-mac-tap: FORCE mkdir -p /Library/Application\ Support/ZeroTier/One