-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_windows.sh
More file actions
executable file
·131 lines (106 loc) · 3.92 KB
/
Copy pathdeploy_windows.sh
File metadata and controls
executable file
·131 lines (106 loc) · 3.92 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env bash
export APP_NAME="OffloadBuddy"
export APP_VERSION=0.12
export GIT_VERSION=$(git rev-parse --short HEAD)
echo "> $APP_NAME packager (Windows x86_64) [v$APP_VERSION]"
## CHECKS ######################################################################
if [ ${PWD##*/} != $APP_NAME ]; then
echo "This script MUST be run from the $APP_NAME/ directory"
exit 1
fi
## SETTINGS ####################################################################
use_contribs=false
make_install=false
create_package=false
upload_package=false
while [[ $# -gt 0 ]]
do
case $1 in
-c|--contribs)
use_contribs=true
;;
-i|--install)
make_install=true
;;
-p|--package)
create_package=true
;;
-u|--upload)
upload_package=true
;;
*)
echo "> Unknown argument '$1'"
;;
esac
shift # skip argument or value
done
## PREP WORK ###################################################################
if [[ -v QT_ROOT_DIR ]]; then
# cleanup undeployable Qt plugins (present, but missing their own dependencies)
# only if we are on a GitHub Action server, because this remove the plugins from the Qt directory
echo '---- Remove undeployable Qt plugins'
sudo rm $QT_ROOT_DIR/plugins/position/qtposition_nmea.dll
fi
## APP INSTALL #################################################################
if [[ $make_install = true ]] ; then
echo '---- Running make install'
make INSTALL_ROOT=bin/ install
#echo '---- Installation directory content recap (after make install):'
#find bin/
fi
## APP DEPLOY ##################################################################
echo '---- Running windeployqt'
windeployqt bin/ --qmldir qml/
#echo '---- MapLibre deployment hack'
#cp $QT_ROOT_DIR/bin/QMapLibre.dll bin/QMapLibre.dll
#cp $QT_ROOT_DIR/bin/QMapLibreLocation.dll bin/QMapLibreLocation.dll
# Copy 3rd party libraries
cp contribs/env/windows_x86_64/usr/lib/exif.dll bin/
cp contribs/env/windows_x86_64/usr/lib/minivideo.dll bin/
# Copy ffmpeg libraries
cp contribs/env/windows_x86_64/usr/lib/avcodec-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/avdevice-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/avfilter-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/avformat-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/avutil-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/postproc-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/swresample-*.dll bin/
cp contribs/env/windows_x86_64/usr/lib/swscale-*.dll bin/
# Copy ffmpeg binary
cp contribs/env/windows_x86_64/usr/bin/ffmpeg.exe bin/
#echo '---- Installation directory content recap (after windeployqt):'
#find bin/
#echo '---- Clean installation directory'
#rm bin/.gitkeep
#rm bin/qmltooling
#rm bin/generic
#rm bin/Qt6QuickControls2WindowsStyleImpl.dll
#rm bin/Qt6QuickControls2UniversalStyleImpl.dll
#rm bin/Qt6QuickControls2Universal.dll
#rm bin/Qt6QuickControls2ImagineStyleImpl.dll
#rm bin/Qt6QuickControls2Imagine.dll
#rm bin/Qt6QuickControls2FusionStyleImpl.dll
#rm bin/Qt6QuickControls2Fusion.dll
#rm bin/Qt6QuickControls2BasicStyleImpl.dll
#rm bin/Qt6QuickControls2Basic.dll
mv bin $APP_NAME
## PACKAGE (zip) ###############################################################
if [[ $create_package = true ]] ; then
echo '---- Compressing package'
7z a $APP_NAME-$APP_VERSION-win64.zip $APP_NAME
fi
## PACKAGE (NSIS) ##############################################################
if [[ $create_package = true ]] ; then
echo '---- Creating installer'
mv $APP_NAME assets/windows/$APP_NAME
makensis assets/windows/setup.nsi
mv assets/windows/*.exe $APP_NAME-$APP_VERSION-win64.exe
fi
## UPLOAD ######################################################################
if [[ $upload_package = true ]] ; then
printf "---- Uploading to transfer.sh"
curl --upload-file $APP_NAME*.zip https://transfer.sh/$APP_NAME-$APP_VERSION-git$GIT_VERSION-win64.zip
printf "\n"
curl --upload-file $APP_NAME*.exe https://transfer.sh/$APP_NAME-$APP_VERSION-git$GIT_VERSION-win64.exe
printf "\n"
fi