File: tune_winres.sh

package info (click to toggle)
libjodycode 4.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,676 kB
  • sloc: ansic: 2,820; makefile: 372; sh: 160; xml: 37
file content (22 lines) | stat: -rwxr-xr-x 1,099 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

WINRES="winres.rc"
WINRES_XP="winres_xp.rc"
WINRES_MAN="winres.manifest.xml"

# Get version number components
VER="$(grep '^#define LIBJODYCODE_VER  *"' libjodycode.h | cut -d\" -f2)"
V1="$(echo "$VER" | cut -d. -f1)"; test -z "$V1" && V1=0
V2="$(echo "$VER" | cut -d. -f2)"; test -z "$V2" && V2=0
V3="$(echo "$VER" | cut -d. -f3)"; test -z "$V3" && V3=0
V4="$(echo "$VER" | cut -d. -f4)"; test -z "$V4" && V4=0
# Build VS_VERSION_INFO product version string with commas
PRODVER="$V1,$V2,$V3,$V4"
# Extend version to include four discrete numbers
XVER="$V1.$V2.$V3.$V4"
echo "$VER  =  $PRODVER ($XVER)"

# Actually change the manifest version information
sed -i 's/\([A-Z]*\)VERSION [0-9],.*/\1VERSION '"$PRODVER/"';s/"\([A-Za-z]*\)Version", "[0-9],.*"/"\1Version", '"\"$PRODVER\"/" "$WINRES"
sed -i 's/\([A-Z]*\)VERSION [0-9],.*/\1VERSION '"$PRODVER/"';s/"\([A-Za-z]*\)Version", "[0-9],.*"/"\1Version", '"\"$PRODVER\"/" "$WINRES_XP"
sed -i 's/assemblyIdentity type="win32" name="libjodycode" version="[^"]*/assemblyIdentity type="win32" name="libjodycode" version="'$XVER/ "$WINRES_MAN"