|
1 | 1 | #!/bin/bash |
2 | | -# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the |
| 2 | +# Copyright (C) 2019 - 2025 by Pedro Mendes, Rector and Visitors of the |
3 | 3 | # University of Virginia, University of Heidelberg, and University |
4 | 4 | # of Connecticut School of Medicine. |
5 | 5 | # All rights reserved. |
|
14 | 14 | # of Manchester. |
15 | 15 | # All rights reserved. |
16 | 16 |
|
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
17 | 26 | # Echo all bash commands to ease debugging |
18 | 27 | set -x |
19 | 28 |
|
|
32 | 41 | GUID=$(echo $GUID | sed 'y/abcdef/ABCDEF/') |
33 | 42 | productcode=${GUID:0:8}-${GUID:8:4}-${GUID:12:4}-${GUID:16:4}-${GUID:20:12} |
34 | 43 |
|
35 | | -[ -e ${SETUP_DIR}/package ] && rm -rf ${SETUP_DIR}/package |
36 | | -mkdir ${SETUP_DIR}/package |
37 | | -pushd ${SETUP_DIR}/package |
38 | | - |
39 | | -# Create directory structure |
40 | | -tar -xvf ${BUILD_ROOT}/src/windows.tgz |
41 | | - |
42 | | -# Copy README |
43 | | -cp ${SOURCE}/README.Win32 README.txt |
44 | | -chmod 644 README.txt |
45 | | - |
46 | | -# Copy license |
47 | | -cp ${SOURCE}/copasi/ArtisticLicense.txt LICENSE.txt |
48 | | -chmod 644 LICENSE.txt |
49 | | - |
50 | | -# Copy configuration resources |
51 | | -mkdir -p share/copasi/config |
52 | | -cp ${SOURCE}/copasi/MIRIAM/MIRIAMResources.xml share/copasi/config |
53 | | -chmod 444 share/copasi/config/* |
54 | | - |
55 | | -# Copy examples |
56 | | -mkdir -p share/copasi/examples |
57 | | -cp ${SOURCE}/TestSuite/distribution/* share/copasi/examples |
58 | | -chmod 444 share/copasi/examples/* |
59 | | -chmod 777 share/copasi/examples |
60 | | - |
61 | | -# Copy icons |
62 | | -mkdir -p share/copasi/icons |
63 | | -cp ${SOURCE}/copasi/UI/icons/Copasi.ico share/copasi/icons |
64 | | -cp ${SOURCE}/copasi/UI/icons/CopasiDoc.ico share/copasi/icons |
65 | | -chmod 644 share/copasi/icons/* |
66 | | - |
67 | | -# Copy wizard resource |
68 | | -mkdir -p share/copasi/doc/html |
69 | | -cp ${SOURCE}/copasi/wizard/help_html/*.html share/copasi/doc/html |
70 | | -chmod 644 share/copasi/doc/html/*.html |
71 | | - |
72 | | -mkdir -p share/copasi/doc/html/figures |
73 | | -cp ${SOURCE}/copasi/wizard/help_html/figures/*.png \ |
74 | | - share/copasi/doc/html/figures |
75 | | -chmod 644 share/copasi/doc/html/figures/*.png |
76 | | - |
77 | | -# 32 bit files |
78 | | -cp "${BUILD_32_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/32 |
79 | | -chmod 755 bin/32/CopasiUI.exe |
80 | | -cp "${BUILD_32_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/32 |
81 | | -chmod 755 bin/32/CopasiSE.exe |
82 | | -cp ${SOURCE}/InnoSetup/qt.conf bin/32 |
83 | | -chmod 644 bin/32/qt.conf |
84 | | - |
85 | | -# 64 bit files |
86 | | -cp "${BUILD_64_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/64 |
87 | | -chmod 755 bin/64/CopasiUI.exe |
88 | | -cp "${BUILD_64_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/64 |
89 | | -chmod 755 bin/64/CopasiSE.exe |
90 | | -cp ${SOURCE}/InnoSetup/qt.conf bin/64 |
91 | | -chmod 644 bin/64/qt.conf |
92 | | - |
93 | | -# Execute InnoSetup to create Installation package |
94 | | -cd ${SOURCE}/InnoSetup |
95 | | - |
96 | | -workdir=$(cygpath -wa .) |
97 | | -workdir=${workdir//\\/\\\\} |
98 | | - |
99 | | -stagedir=$(cygpath -wa "${SETUP_DIR}/package") |
100 | | -stagedir=${stagedir//\\/\\\\} |
| 44 | +# if NO_COPY environment variable is set, skip the copy step |
| 45 | +if [ -n "${NO_COPY}" ]; then |
| 46 | + echo "Skipping copy step" |
| 47 | + cd ${SOURCE}/InnoSetup |
| 48 | + |
| 49 | + workdir=${SOURCE}/InnoSetup |
| 50 | + workdir=$(echo "$workdir" | sed 's/\//\\/g') |
| 51 | + workdir=$(echo "$workdir" | sed 's/^\\c\\/C:\\/') |
| 52 | + workdir=$(echo "$workdir" | sed 's/^\\d\\/D:\\/') |
| 53 | + workdir=$(echo "$workdir" | sed 's/^\\e\\/E:\\/') |
| 54 | + workdir=${workdir//\\/\\\\} |
| 55 | + |
| 56 | + stagedir=${SETUP_DIR}/package |
| 57 | + stagedir=$(echo "$stagedir" | sed 's/\//\\/g') |
| 58 | + stagedir=$(echo "$stagedir" | sed 's/^\\c\\/C:\\/') |
| 59 | + stagedir=$(echo "$stagedir" | sed 's/^\\d\\/D:\\/') |
| 60 | + stagedir=$(echo "$stagedir" | sed 's/^\\e\\/E:\\/') |
| 61 | + |
| 62 | + stagedir=${stagedir//\\/\\\\} |
| 63 | + |
| 64 | +else |
| 65 | + |
| 66 | + [ -e ${SETUP_DIR}/package ] && rm -rf ${SETUP_DIR}/package |
| 67 | + mkdir ${SETUP_DIR}/package |
| 68 | + pushd ${SETUP_DIR}/package |
| 69 | + |
| 70 | + # Create directory structure |
| 71 | + tar -xvf ${BUILD_ROOT}/src/windows.tgz |
| 72 | + |
| 73 | + # Copy README |
| 74 | + cp ${SOURCE}/README.Win32 README.txt |
| 75 | + chmod 644 README.txt |
| 76 | + |
| 77 | + # Copy license |
| 78 | + cp ${SOURCE}/copasi/ArtisticLicense.txt LICENSE.txt |
| 79 | + chmod 644 LICENSE.txt |
| 80 | + |
| 81 | + # Copy configuration resources |
| 82 | + mkdir -p share/copasi/config |
| 83 | + cp ${SOURCE}/copasi/MIRIAM/MIRIAMResources.xml share/copasi/config |
| 84 | + chmod 444 share/copasi/config/* |
| 85 | + |
| 86 | + # Copy examples |
| 87 | + mkdir -p share/copasi/examples |
| 88 | + cp ${SOURCE}/TestSuite/distribution/* share/copasi/examples |
| 89 | + chmod 444 share/copasi/examples/* |
| 90 | + chmod 777 share/copasi/examples |
| 91 | + |
| 92 | + # Copy icons |
| 93 | + mkdir -p share/copasi/icons |
| 94 | + cp ${SOURCE}/copasi/UI/icons/Copasi.ico share/copasi/icons |
| 95 | + cp ${SOURCE}/copasi/UI/icons/CopasiDoc.ico share/copasi/icons |
| 96 | + chmod 644 share/copasi/icons/* |
| 97 | + |
| 98 | + # Copy wizard resource |
| 99 | + mkdir -p share/copasi/doc/html |
| 100 | + cp ${SOURCE}/copasi/wizard/help_html/*.html share/copasi/doc/html |
| 101 | + chmod 644 share/copasi/doc/html/*.html |
| 102 | + |
| 103 | + mkdir -p share/copasi/doc/html/figures |
| 104 | + cp ${SOURCE}/copasi/wizard/help_html/figures/*.png \ |
| 105 | + share/copasi/doc/html/figures |
| 106 | + chmod 644 share/copasi/doc/html/figures/*.png |
| 107 | + |
| 108 | + # 32 bit files |
| 109 | + cp "${BUILD_32_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/32 |
| 110 | + chmod 755 bin/32/CopasiUI.exe |
| 111 | + cp "${BUILD_32_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/32 |
| 112 | + chmod 755 bin/32/CopasiSE.exe |
| 113 | + cp ${SOURCE}/InnoSetup/qt.conf bin/32 |
| 114 | + chmod 644 bin/32/qt.conf |
| 115 | + |
| 116 | + # 64 bit files |
| 117 | + cp "${BUILD_64_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/64 |
| 118 | + chmod 755 bin/64/CopasiUI.exe |
| 119 | + cp "${BUILD_64_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/64 |
| 120 | + chmod 755 bin/64/CopasiSE.exe |
| 121 | + cp ${SOURCE}/InnoSetup/qt.conf bin/64 |
| 122 | + chmod 644 bin/64/qt.conf |
| 123 | + |
| 124 | + # Execute InnoSetup to create Installation package |
| 125 | + cd ${SOURCE}/InnoSetup |
| 126 | + |
| 127 | + workdir=$(cygpath -wa .) |
| 128 | + workdir=${workdir//\\/\\\\} |
| 129 | + |
| 130 | + stagedir=$(cygpath -wa "${SETUP_DIR}/package") |
| 131 | + stagedir=${stagedir//\\/\\\\} |
| 132 | + |
| 133 | +fi |
| 134 | + |
| 135 | + |
101 | 136 |
|
102 | 137 | # modify product code, product version, and package name |
103 | 138 | sed -e '/#define MyAppVersion/s/".*"/"'${MyAppVersion}'"/' \ |
|
0 commit comments