new build method for Mac disk image, please test

  1. A new build method for Mac disk images was suggested to me by someone
    on Apple’s Java dev list today, viz. that I can use one call to mkisofs
    to do the job instead of the horribly complex mess of shell scripting I
    was using (which involved calls to dd, du, sed, mkfs, mkdir, sudo,
    mount, cp, umount, and rmdir, along with shell arithmetic).

  2. It was also suggested to me that on a Mac a gzipped disk image will
    automatically be ungzipped when you download it, so I’ve started gzipping
    the Mac builds, which saves us 2MB per download.

  3. Let me know if I have the file associations for .vmod correct here.

nomic.net/~uckelman/tmp/vass … osx.dmg.gz

uckelman wrote:

Something’s not right - the top level of the image has the Contents
folder in it, not VASSAL.app.

This only works if you have Safari set to automatically handle
downloaded ‘safe’ files. Unfortunately this is the option we keep
telling Mac users to turn off, because it also automatically unzips
mods when they’re either named as .zip (or .mod.zip) or the server sends
the corresponding mime-type. The resulting unzipped mod can’t be
opened, and Safari helpfully throws away the downloaded file - much
confusion ensues :frowning:

Not tested, due to failing at point 1.

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

I didn’t realize that mkisofs (actually, genisoimage) would dump the
contents of the directory given into the root of the image, instead
of putting the directory given into the root of the image. I think
I’ve fixed this now.

Aha. Ok, I won’t do that, then. Saving 2MB is not so significant as to
warrrant the confusion it will cause.

Try this one:

nomic.net/~uckelman/tmp/vass … macosx.dmg


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel Uckelman wrote:

It works now, but gives a warning on opening that the image file may be
corrupt. I’ll have a prod at it with Disk Utility later and see if I
can find out what it doesn’t like about it.

The file associations work in that if you double-click on a .vmod, it
tries to open VASSAL. However, spawing the player then throws a
NullPointerException:

– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3533
– VASSAL instance 805766127682783920
– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3533
– VASSAL instance -4578785155208304860
java.lang.NullPointerException
at VASSAL.launch.Player.createDataArchive(Player.java:241)
at VASSAL.launch.Player.launch(Player.java:207)
at VASSAL.launch.Player.extractResourcesAndLaunch(Player.java:149)
at VASSAL.launch.Player$1.run(Player.java:113)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:190)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

The player then hangs, and has to be killed from the CLI. The same
thing happens if you rename any existing .mod to .vmod, and then open it
from the Module Manager. Rename it back to .mod and it opens fine -
although then the file association is of course lost.

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

Thanks. Let me know what you find.

Alright, try this one:

nomic.net/~uckelman/tmp/vass … macosx.dmg


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel Uckelman wrote:

Many instances of “Reserved fields in the Catalogue record contain
incorrect data”, which I have very little idea what it means.

Still the same issue on trying to open a .vmod (by double-clicking the
file, or by opening from MM):

– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3534
– VASSAL instance 2232620887672535473
– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3534
– VASSAL instance -3374428428287584379
java.lang.NullPointerException
at VASSAL.launch.Player.createDataArchive(Player.java:261)
at VASSAL.launch.Player.launch(Player.java:227)
at VASSAL.launch.Player.extractResourcesAndLaunch(Player.java:151)
at VASSAL.launch.Player$1.run(Player.java:115)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:190)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

I have no idea what that means. I hope that someone can find out for
me, since this method of creating DMGs is superior to the way I was
doing it in most other ways.

Wait—it fails when you try to open it from the MM?!! ARGH!!!

Try this one. There should be some diagnosic output in the errorLog,
which looks like “lr.module = path/to/something”.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Joel Uckelman:

Sorry, I didn’t provide the link:

nomic.net/~uckelman/tmp/vass … macosx.dmg


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel Uckelman wrote:

That one works fine, both for double-clicking a .vmod or for opening a
.vmod from within the MM.

I’m not getting any joy with the ‘corrupt’ image warning though - can
you let me have the script you’re using to create it? Something might
suggest itself from looking…

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

Fantastic. I guess that finishes off the first round of Mac-ification.
(There are some other things we should do, like maybe look at using
Quaqua for the LookAndFeel, and add a Windows menu, but I don’t think
I could stand to mess with this too much more without a break first.)

Sure, here are the Makefile targets:

Old:

$(TMPDIR)/VASSAL-$(VERSION)-macosx.dmg: $(TMPDIR)/VASSAL-$(VERSION).app
dd if=/dev/zero of=$@ bs=1M count=$$(( du -s $< | sed 's/\s\+.*$$//' / 1024 + 1 ))
mkfs.hfsplus -s -v VASSAL-$(VERSION) $@
mkdir -p $(TMPDIR)/dmg
sudo sh -c “mount -t hfsplus -o loop $@ $(TMPDIR)/dmg ; cp -va $< $(TMPDIR)/dmg ; umount $(TMPDIR)/dmg”
rmdir $(TMPDIR)/dmg

New:

$(TMPDIR)/VASSAL-$(VERSION)-macosx.dmg: $(TMPDIR)/VASSAL-$(VERSION).app
genisoimage -V VASSAL-$(VERSION) -r -hfs -root VASSAL-$(VERSION).app -o $@ $<


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On May 4, 2008, at 12:00 PM, Joel Uckelman wrote:

Here’s what I found:

<http://developer.apple.com/technotes/tn/tn1150.html#ReservedAndPadFields

It basically says that there are certain reserved fields that should
be zero-filled, so I assume that there are some of these reserved (but
at least currently unused) fields that have some other left-over data
in them.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

Do you know how to get genisoimage not to produce DMGs with this problem?
What would be most helpful is is someone could experiment with genisoimage
on a Mac and then tell me which combination of options works.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel Uckelman wrote:

Dock icons and names too - but that (I think) is just tweaking the
Info.plist and the command-line for the spawned Player / Editor.

‘-apple’ instead of ‘-hfs’ gives what seems to be a working image with
the warnings removed. OK, so it’s ISO9660 with RockRidge (and some
Apple bits?), rather than a real HFS image, but it seems that all the
files come out of the other end intact…

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

The icons don’t exist yet. (I’ve asked a graphic designer friend of
mine for some sketches, so we’ll have some more options.)

What exactly is missing for the Player and Editor? What options do
I need to add?

Alright. Thanks for checking that. Does it matter at all whether it’s
HFS or ISO9660?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Joel Uckelman wrote:

Ah, OK, I’d lost track there.

-Xdock:icon=“path/to/icon/file.icns” -Xdock:name=“Application Name”

to the invocation of Java.

The dock:name is the tooltip you get if you hover over the dock icon,
and also in the task switcher pop-up if you hold alt-tab to task switch.
(Effectively the same thing that would show up in the Windows task bar).

I don’t know if the intention is to have the MM, Player and Editor all
show up with an application name (“VASSAL”), or distinct “VASSAL”,
“VASSAL Player”, “VASSAL Editor”; similarly with the icons.

It seems not to - and in theory I don’t think it should, the RR et al
should give a way of mapping filenames down to ISO9660, and we’re not,
to the best of my knowledge, relying on any resource forks. I’d like to
see someone other than me confirm it though - and preferably against
your build from a changed script, not me hacking around with an existing
VASSAL.app. (Although my test image was built on Linux, so I’m pretty
sure it’s not relying on genisoimage having access to anything you won’t
have in your build environment…)

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Tim Franklin:

Do you have any thoughs on which way would be better? (This goes for
all platforms.)

My most recent build was made is that way:

nomic.net/~uckelman/tmp/vass … macosx.dmg


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Dont know about others, but I think I would like to see all three as distinct with own icons, and ultimately travel this path to the module level for designers to add their own module specific icons which could display in the MM (via metadata?). This will make file identification easier for users when outside of MM also if they have numerous mods/savs logs all over etc… having module specific icons

Already quite a number of modules Ive noticed provide a .ico inside their zip, but it is currently incumbent upon the user to know its in there and know how to associate/change icons. Not everybody knows how to do this though and its for the mod file only.
I had kind of thought this would be more related to GUI though, why I never mentioned before.

Joel Uckelman wrote:

I’d like to see the three distinct one way or the other. Maybe the
Player icon could have either a die or the ‘play’ symbol (solid
right-pointing triangle) overlayed on the regular VASSAL icon, and the
Editor some kind of tool? I don’t know if anyone other than Mac users
ever sees the icons big enough to care…

A consideration from the Windows side may be what either option does to
the taskbar ‘group similar windows’ option - and what people want it do.
I’m not going to way in on that one though, as I very rarely use
VASSAL under Windows.

No warnings from the image, application looks to work fine. At least, I
can launch the MM, Player, Editor and access the docs - haven’t tried to
play through a game with it.

Cheers,
Tim.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Tim M”:

I really like this idea, BTW; I’ll implement this eventually, but not
for 3.1.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)