Index: build_tools/dmgpack.sh
===================================================================
--- build_tools/dmgpack.sh	(revision 369ac54e92fd700fe5ef6cba0597f8f6d6b6c6fd)
+++ build_tools/dmgpack.sh	(revision 369ac54e92fd700fe5ef6cba0597f8f6d6b6c6fd)
@@ -0,0 +1,65 @@
+#! /bin/bash
+
+# dmgpack volume [file|dir]+
+#
+#    Copy a group of files/directories to a compressed disk image.
+#    The resulting image is stored in volume.dmg.
+#
+#    Files are copied with 'ditto' to preserve resource forks.  For
+#    convenience we also call FixupResourceForks after copying.  This
+#    allows you to use /Developer/Tools/SplitFork on your tree and 
+#    manipulate it with CVS, tar, etc.  Don't forget the -kb option 
+#    when adding or committing app and ._app files to CVS!
+#
+#    This command will fail if a volume of the given name is already
+#    mounted.  It could also fail if the size of the resource forks
+#    is large compared to the size of the data forks. Change the
+#    scale factor internally from 11/10 to a more appropriate number
+#    if it complains it is running out of space.
+#
+#    It is possible to add a license agreement to a dmg file.  See
+#    the "Software License Agreements for UDIFs" sdk available at
+#    http://developer.apple.com/sdk/index.html
+
+test $# -lt 2 && echo "usage: $0 diskname [file|dir]+" && exit 1
+#set -x
+NAME="${1%.dmg}" ; shift
+DISK=/tmp/dmgpack$$.dmg
+COMPRESSED="$NAME.dmg"
+VOLUME="$NAME"
+
+# compute needed image size; scale it by 10%
+SIZE=$(du -ck "$@" | tail -1 | sed -e 's/ *total//')
+SIZE=$(echo $SIZE*11/10 | bc)
+test $SIZE -lt 4200 && SIZE=4200
+
+# create the disk
+rm -f $DISK
+hdiutil create -size ${SIZE}k $DISK -layout NONE
+
+# create a file system on the disk; last line of output is
+# the device on which the disk was attached.
+DEVICE=$(hdiutil attach $DISK -nomount | tail -1)
+newfs_hfs -v "$VOLUME" $DEVICE
+
+# mount the file system
+mkdir $DISK-mount
+mount -t hfs $DEVICE $DISK-mount || (echo "mount $DISK-mount failed" && exit 1)
+
+# copy stuff to the disk and fixup resource forks
+for f in "$@"; do 
+    f=${f%/}		;# strip trailing /
+    dest="$DISK-mount/${f##*/}"
+    ditto -rsrc "$f" "$dest" 
+    test -d "$f" && /System/Library/CoreServices/FixupResourceForks "$dest"
+done
+
+# eject the disk
+umount $DISK-mount
+rmdir $DISK-mount
+hdiutil eject $DEVICE
+
+# compress the disk and make it read only
+rm -f "$COMPRESSED"
+hdiutil convert -format UDZO $DISK -imagekey zlib-level=9 -o "$COMPRESSED"
+rm -f $DISK
Index: build_tools/jenkins_osx_build.sh
===================================================================
--- build_tools/jenkins_osx_build.sh	(revision 460f5f28b60461087d1144a7e83ae444de6b09e4)
+++ build_tools/jenkins_osx_build.sh	(revision a003f3c77c1e17697db4e00f217c71b9d125bf0f)
@@ -47,3 +47,3 @@
 
 cd $WORKSPACE/sasview/dist
-tar -czf `python -c "import pkg_resources;print '%s.tar.gz' % pkg_resources.get_distribution('sasview').egg_name()"` sasview.app
+tar -czf `python -c "import pkg_resources;print '%s.tar.gz' % pkg_resources.get_distribution('sasview').egg_name()"` `python -c "import sasview; print 'SasView-%s.app' % sasview.__version__"`
Index: sasview.latestversion
===================================================================
--- sasview.latestversion	(revision 0ea31caa7c7dff8f23817dfa04e8be1d9dd3f8d8)
+++ sasview.latestversion	(revision 9533593bd68a5d03ddc7e4bfede0191634e13336)
@@ -1,1 +1,1 @@
-3.1.0
+3.1.1
Index: sasview/README.txt
===================================================================
--- sasview/README.txt	(revision be34c716631ba9e991c98104f30dcc2c00c510fa)
+++ sasview/README.txt	(revision 9533593bd68a5d03ddc7e4bfede0191634e13336)
@@ -4,4 +4,9 @@
 1- Features
 ===========
+
+   - New in Version 3.1.1
+     --------------------
+     - Fixes bug #457 that prevented SasView from starting if the user was not
+       connected to the internet, or was behind a proxy server.
 
    - New in Version 3.1.0
Index: sasview/__init__.py
===================================================================
--- sasview/__init__.py	(revision bc84fa7ee20ffc3ec40239d645a48f79863db33d)
+++ sasview/__init__.py	(revision 9533593bd68a5d03ddc7e4bfede0191634e13336)
@@ -1,2 +1,2 @@
-__version__ = "3.1.0"
+__version__ = "3.1.1"
 __build__ = "1"
Index: sasview/setup_mac.py
===================================================================
--- sasview/setup_mac.py	(revision 018582fab454a9dec3a4a7c811c9d49d1495e95a)
+++ sasview/setup_mac.py	(revision 49cd7122b6a4b227afe01531b2ebf4c8508aebf2)
@@ -116,4 +116,11 @@
                                    CFBundleTypeRole="Shell" )],)
 
+#Get version - NB nasty hack. Need to find correct way to give path to installed sasview (AJJ)
+import __init__ as sasviewver
+
+VERSION = sasviewver.__version__
+APPNAME = "SasView "+VERSION
+DMGNAME = "SasView-"+VERSION
+
 APP = ['sasview.py']
 DATA_FILES += ['images','test','media']
@@ -133,5 +140,5 @@
            }
 setup(
-    name="sasview",
+    name=APPNAME,
     app=APP,
     data_files=DATA_FILES,
@@ -140,2 +147,9 @@
     setup_requires=['py2app'],
 )
+
+#Build dmg
+DMG="dist/%s.dmg"%DMGNAME
+if os.path.exists(DMG): os.unlink(DMG)
+os.system('cd dist && ../../build_tools/dmgpack.sh "%s" "%s.app"'%(DMGNAME,APPNAME))
+os.system('chmod a+r "%s"'%DMG)
+
