Permalink
Browse files

OSX package: Check for 64-bit Intel CPU before installing.

  • Loading branch information...
1 parent 5fe6343 commit 0d095be64f189def9324a1b323f0943d90224eb1 John MacFarlane committed Mar 9, 2012
Showing with 19 additions and 0 deletions.
  1. +2 −0 make_osx_package.sh
  2. +14 −0 osx-resources/InstallationCheck
  3. +3 −0 osx-resources/InstallationCheck.strings
View
@@ -4,6 +4,7 @@ DIST=osx_package
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
RESOURCES=$DIST/Resources
ROOT=$DIST/pandoc
+SCRIPTS=osx-resources
BASE=pandoc-$VERSION
ME=jgm
@@ -36,6 +37,7 @@ $PACKAGEMAKER \
--resources $RESOURCES \
--version $VERSION \
--no-relocate \
+ --scripts $SCRIPTS \
--out $BASE.pkg
echo Creating disk image...
@@ -0,0 +1,14 @@
+#!/bin/sh
+cputype=`sysctl -n hw.cputype`
+sixtyfourbit=`sysctl -n hw.cpu64bit_capable`
+
+if [ "x$cputype" != "x7" ] # x86
+then
+ exit 112
+fi
+
+if [ "x$sixtyfourbit" != "x1" ] # 64 bit
+then
+ exit 113
+fi
+
@@ -0,0 +1,3 @@
+"16" = "This installer works only on Intel Macs.";
+"17" = "This installer requires a 64-bit processor.";
+

0 comments on commit 0d095be

Please sign in to comment.