3 # all these shall be defined in a .brand file passed as first argument
10 icon_icns=Darkplaces.app/Contents/Resources/Darkplaces.icns
11 icon_ico=darkplaces.ico
12 icon_xpm=darkplaces.xpm
15 if [ -z "$1" ] || [ x"$1" = x"--help" ]; then
16 echo "Usage: $0 brandfile binaries..."
22 t=`mktemp -d -t darkplaces-rebrand.XXXXXX`
24 flags="$flags -customgamename \"$name\" -customgamedirname1 \"$dirname1\" -customgamedirname2 \"$dirname2\" -customgamescreenshotname \"$screenshotname\" -customgameuserdirname \"$userdirname\""
25 echo "$flags" > "$t/darkplaces.opt"
28 zip -9r darkplaces.zip darkplaces.opt
32 for EXECUTABLE in "$@"; do
37 # detect what the executable is
38 case "`file -b "$EXECUTABLE"`" in
64 cp "$t/darkplaces.zip" "$t/darkplaces-this.zip"
67 cp "$icon_xpm" "$t/darkplaces-icon.xpm"
69 for i in $icons_tga; do
70 convert "$i" "$t/darkplaces-icon$cnt.tga"
71 if [ -z "$cnt" ]; then
78 zip -9r darkplaces-this.zip darkplaces-icon*
83 cp "$icon_ico" "$t/darkplaces-icon.ico"
84 cp "$EXECUTABLE" "$t/darkplaces.exe"
85 cat >"$t/darkplaces.rc" <<EOF
86 #include <windows.h> // include for version info constants
88 A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "darkplaces-icon.ico"
92 PRODUCTVERSION 1,0,0,0
95 BLOCK "StringFileInfo"
99 VALUE "CompanyName", "Forest Hale Digital Services"
100 VALUE "FileVersion", "1.0"
101 VALUE "FileDescription", "$name"
102 VALUE "InternalName", "${EXECUTABLE##*/}"
103 VALUE "LegalCopyright", "id Software, Forest Hale, and contributors"
104 VALUE "LegalTrademarks", ""
105 VALUE "OriginalFilename", "${EXECUTABLE##*/}"
106 VALUE "ProductName", "$name"
107 VALUE "ProductVersion", "1.0"
113 wine "c:/Program Files/ResEdit/ResEdit.exe" -convert darkplaces.rc darkplaces.exe
115 mv "$t/darkplaces.exe" "$EXECUTABLE"
119 # OS X is special here
120 case "$EXECUTABLE" in
122 pkgdir="${EXECUTABLE%/*}/.."
128 if [ -d "$pkgdir/Resources" ]; then
129 cp "$icon_icns" "$pkgdir/Resources/Darkplaces.icns"
130 cat <<EOF >"$pkgdir/Resources/English.lproj/InfoPlist.strings"
131 /* Localized versions of Info.plist keys */
133 CFBundleName = "$name";
134 CFBundleShortVersionString = "$name";
135 CFBundleGetInfoString = "Darkplaces by Forest 'LordHavoc' Hale";
136 NSHumanReadableCopyright = "Copyright `date +%Y`";
141 cat "$t/darkplaces-this.zip" >> "$EXECUTABLE"