nbalonso.com

Auto Select in DeployStudio

| Comments

We are heavy users of DeployStudio at the office and recently we updated our Bootcamp images to the new version 5 to make them compatible with newer and older machines.

Is not just once or twice that we faced an issue with a customers computer because it has the wrong version of Bootcamp installed, things like brightness, selecting the bootable drive, volume keys, mouse speed, sound and so on will go wrong in such cases.

Usually we rely on our technicians to select the correct image for each computer. Naming the images to things like Windows.mbpro9 did not really help so we decided to use the embed workflows option. I wrote this script so that regardless of the workflow selected the correct image is block copied.

The initial workflow looks like this

the destination workflow called from the script is just this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

#Models that always will get Windows 64bit with Bootcamp 5
case "$DS_MODEL_IDENTIFIER" in
    "MacBookPro9,1")    echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "MacBookPro9,2")    echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "MacBookPro10,1")   echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "MacBookPro10,2")   echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "MacPro4,1")        echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "MacPro5,1")        echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "Macmini5,1")       echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "Macmini5,2")       echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "Macmini5,3")       echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "Macmini6,1")       echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "Macmini6,2")       echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "iMac11,3")         echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "iMac12,1")         echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "iMac12,2")         echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "iMac13,1")         echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
    "iMac13,2")         echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)" && exit 0;;
esac

#MacBooPro eights should get Bootcamp 5 ONLY when requested to have 64 bit OS
if [ "`echo $DS_MODEL_IDENTIFIER | grep MacBookPro8`" != "" ] && [ "`echo $DS_CURRENT_WORKFLOW_TITLE | grep 64bit`" != "" ] ; then
    echo "RuntimeSelectWorkflow: Z Install Windows with Bootcamp 5 64bit (script selected)"
    exit 0
fi

#2009 iMacs should always get 32 so that the sound works
if [ "$DS_MODEL_IDENTIFIER" == "iMac9,1" ]; then
    echo "RuntimeSelectWorkflow: Z Install Windows generic 32bit (script selected)"
    exit 0
fi

####Any other model section####
if [ "`echo $DS_CURRENT_WORKFLOW_TITLE | grep 32bit`" != "" ]; then
    echo "RuntimeSelectWorkflow: Z Install Windows generic 32bit (script selected)"
    exit 0
else
    echo "RuntimeSelectWorkflow: Z Install Windows generic 64bit (script selected)"
    exit 0
fi

#if to this point nothing is selected echo the problem and throw an error
echo "Unable to select the correct windows for this machine. Please contact your systems administrator"
exit -1

Comments