Sure - my cut 'n' paste skills aren't what they used to be and my
script is now below. Ideally, the script would examine disk0 to
verify there was enough space available before partitioning. This
is assuming a 20G partition for Windows and, let's say, 30G
additional free space for additional/updated applications.
If you are scripting things I would be really careful about using
'disk0' and 'disk1', these assignments are non-deterministic. So
during one boot the drive in 'bay 1' can be 'disk0', and the next boot
it might be the disk in 'bay 2'. It seems that whichever disk comes up
first (internal ones seem to always come up first) is 'disk0', and
this pays no attention to what drive is booted from.
My solution for this was to code everything in C, and then to match
the IOKit path of the drives against a list I built telling me what
was 'bay 1' and 'bay 2' to see if I could figure this out. The code
works well for systems that I had access to, but has the down-side
that the table of models needs to be kept up-to-date.
There is a private framework that DiskUtility uses to get this
string, but it has a couple of problems for my purposes: It is
private, and so can move and change without warning. And it returns
completely different strings for PowerMacs than it does for MacPro's,
and it does not return anything for iMacs, meaning that I needed to
have complex logic to figure this out anyways (what I already had was
simpler).
I have plans to do a re-write of that code so that I can open-source
it, but in the mean time I can definitely provide the data for the
models I have, and pointers about how to do what I did if someone
wants them.