Debian Codegraph @

win32/make_msi.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 adonthell_exe="adonthell-0.3.exe"
4
5 # -- check arg
6 if testscip-shell system . . test. "x$1" = "x" ; then
7 echoscip-shell system . . echo. "Usage: $0 <path/to/Adonthell>"
8 exit 1
9 fi
10
11 if testscip-shell system . . test. ! -f $1"/bin/$adonthell_exe" ; then
12 echoscip-shell system . . echo. "Error: $1 is not the expected adonthell package"
13 exit 1
14 fi
15
16 # -- determine installer architecture (x64 or x86)
17 arch=`filescip-shell system . . file. $1"/bin/$adonthell_exe" | grepscip-shell system . . grep. -o -e x86-64 -e 80386`
18 case $arch in
19 x86-64)
20 arch="x64"
21 ;;
22 80386)
23 arch="x86"
24 ;;
25 *)
26 echoscip-shell system . . echo. "Unknown platform $arch"
27 exit 1
28 ;;
29 esac
30
31 # -- check working directory
32 if [scip-shell system . . `[`. ! -f "wastesedge.wxs" ]; then
33 echoscip-shell system . . echo. "This script must be run in the wastesedge-0.3.x/win32 directory"
34 exit 1
35 fi
36
37 # -- check Wix Toolkit
38 if [scip-shell system . . `[`. ! -x "$(command -v heat)" ]; then
39 echoscip-shell system . . echo. "This script requires the WiX toolset installed and in your PATH"
40 echoscip-shell system . . echo. "See http://wixtoolset.org/"
41 exit 1
42 fi
43
44 # -- get adonthell version
45 adonthell_ver=`$1/bin/$adonthell_exe -v`
46
47 # -- codesign Adonthell exe
48 if [scip-shell system . . `[`. -x "$(command -v signtool)" ]; then
49 echoscip-shell system . . echo. "Codesigning $adonthell_exe"
50 MSYS2_ARG_CONV_EXCL=/tscip-shell filesystem . . `/t`. signtool.exe sign /tscip-shell filesystem . . `/t`. http://timestamp.comodoca.com/authenticode $1/bin/$adonthell_exe
51 fi
52
53 echoscip-shell system . . echo. "Creating wastesedge-$adonthell_ver-$arch.msi"
54
55 # -- check if the User Manual.pdf is present
56 if [scip-shell system . . `[`. ! -f "../User\ Manual.pdf" ]; then
57 manual=1
58 else
59 echoscip-shell system . . echo. "PDF Manual not present. Will not be included in installer."
60 manual=0
61 fi
62
63 # -- clean up any __pycache__ directories before collecting package contents
64 findscip-shell system . . find. $1 -name __pycache__ -execdir rm -rf __pycache__ \;
65
66 # -- collect package contents
67 heat dir "$1" -cg WastesedgePackage -dr INSTALLDIR -gg -sfrag -srd -sw5150 -template fragment -out package.wxs
68 if [scip-shell system . . `[`. $? -ne 0 ]; then
69 exit 1
70 fi
71
72 # -- compile
73 candle -arch $arch -dVersion="$adonthell_ver" -dArch="$arch" -dHaveManual="$manual" wastesedge.wxs package.wxs
74 if [scip-shell system . . `[`. $? -ne 0 ]; then
75 exit 1
76 fi
77
78 # -- link
79 light -b $1 -sw1076 -ext WixUIExtension wastesedge.wixobj package.wixobj -o wastesedge-$adonthell_ver-$arch.msi
80 if [scip-shell system . . `[`. $? -ne 0 ]; then
81 exit 1
82 fi
83
84 # -- codesign installer
85 if [scip-shell system . . `[`. -x "$(command -v signtool)" ]; then
86 echoscip-shell system . . echo. "Codesigning wastesedge-$adonthell_ver-$arch.msi"
87 MSYS2_ARG_CONV_EXCL="/d;/tscip-shell filesystem . . `/d;/t`." signtool.exe sign /tscip-shell filesystem . . `/t`. http://timestamp.comodoca.com/authenticode /dscip-shell filesystem . . `/d`. "Adonthell - Waste's Edge v$adonthell_ver ($arch)" wastesedge-$adonthell_ver-$arch.msi
88 fi
89
90 # -- cleanup
91 rmscip-shell system . . rm. wastesedge-$adonthell_ver-$arch.wixpdb
92 rmscip-shell system . . rm. wastesedge.wixobj
93 rmscip-shell system . . rm. package.wixobj
94 rmscip-shell system . . rm. package.wxs