-
- # Copy the demo and samples to the disk image from the tarball
- pushd $DMGDIR/root/Samples
- tar xzvf $TARBALLDIR/wxPythonDemo-$VERSION.tar.gz
- mv wxPython-$VERSION/* .
- rm -rf wxPython-$VERSION
- rm demo/b demo/.setup.sh
- mv demo/demo.py demo/demo.pyw
- popd
-
+
+
+ if [ ! -e $TARBALLDIR/wxPythonDemo-$VERSION.tar.gz ]; then
+ cat > "$DMGDIR/root/Samples/Build ERROR.txt" <<EOF
+
+The wxPythonDemo tarball was not found when building this disk image!
+
+EOF
+ cp "$DMGDIR/root/Samples/Build ERROR.txt" $DMGDIR/root/Apps
+
+ else
+
+ # Copy the demo and samples to the disk image from the tarball
+ pushd $DMGDIR/root/Samples
+ tar xzvf $TARBALLDIR/wxPythonDemo-$VERSION.tar.gz
+ mv wxPython-$VERSION/* .
+ rm -rf wxPython-$VERSION
+ rm demo/b demo/.setup.sh
+ mv demo/demo.py demo/demo.pyw
+ popd
+
+ # Make an app bundle to run the demo
+ $PYTHONW $PROGDIR/../buildapp.py \
+ --builddir=$DMGDIR/root/Apps \
+ --name="wxPython Demo" \
+ --mainprogram=$DMGDIR/root/Samples/demo/demo.pyw \
+ --iconfile=$PROGDIR/RunDemo.icns \
+ build
+ cp -pR $DMGDIR/root/Samples/demo/* "$DMGDIR/root/Apps/wxPython Demo.app/Contents/Resources"
+ fi
+