Skip to content

Commit 94f02af

Browse files
authored
Add debugging to Apple installer (#1151)
* Add debugging to Apple, Linux installers
1 parent a7c0b7e commit 94f02af

4 files changed

+24
-6
lines changed

ant/apple/apple-postinstall.sh.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
DIR=$(cd "$(dirname "$0")" && pwd)
88
pushd "$DIR/payload/${project.name}.app/Contents/MacOS/"
99

10-
./"${project.name}" install
10+
./"${project.name}" install >> "${install.log}" 2>&1
1111
popd
1212

1313
# Use install target from pkgbuild, an undocumented feature; fallback on sane location
@@ -17,7 +17,7 @@ else
1717
pushd "/Applications/${project.name}.app/Contents/MacOS/"
1818
fi
1919

20-
./"${project.name}" certgen
20+
./"${project.name}" certgen >> "${install.log}" 2>&1
2121

2222
# Start qz by calling open on the .app as an ordinary user
2323
su "$USER" -c "open ../../" || true

ant/apple/apple-preinstall.sh.in

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,29 @@
33
# Halt on first error
44
set -e
55

6+
# Clear the log for writing
7+
> "${install.log}"
8+
9+
# Log helper
10+
dbg () {
11+
echo -e "[BASH] $(date -Iseconds)\n\t$1" >> "${install.log}" 2>&1
12+
}
13+
614
# Get working directory
15+
dbg "Calculating working directory..."
716
DIR=$(cd "$(dirname "$0")" && pwd)
8-
pushd "$DIR/payload/${project.name}.app/Contents/MacOS/"
17+
dbg "Using working directory $DIR"
18+
dbg "Switching to payload directory $DIR/payload/${project.name}.app/Contents/MacOS/"
19+
pushd "$DIR/payload/${project.name}.app/Contents/MacOS/" >> "${install.log}" 2>&1
920

1021
# Offer to download Java if missing
11-
if ! ./"${project.name}" --version; then
22+
dbg "Checking for Java in payload directory..."
23+
if ! ./"${project.name}" --version >> "${install.log}" 2>&1; then
24+
dbg "Java was not found"
1225
osascript -e "tell app \"Installer\" to display dialog \"Java is required. Please install Java and try again.\""
1326
sudo -u "$USER" open "${java.download}"
1427
exit 1
1528
fi
1629

17-
./"${project.name}" preinstall
30+
dbg "Java was found in payload directory, running preinstall"
31+
./"${project.name}" preinstall >> "${install.log}" 2>&1

ant/linux/linux-installer.sh.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ mask=755
2020

2121
echo -e "Starting install...\n"
2222

23+
# Clear the log for writing
24+
> "${install.log}"
25+
2326
run_task () {
2427
echo -e "Running $1 task..."
2528
if [ -n "$DEBUG" ]; then
2629
"./${project.filename}" $@ && ret_val=$? || ret_val=$?
2730
else
28-
"./${project.filename}" $@ &> /dev/null && ret_val=$? || ret_val=$?
31+
"./${project.filename}" $@ &>> "${install.log}" && ret_val=$? || ret_val=$?
2932
fi
3033

3134
if [ $ret_val -eq 0 ]; then

ant/project.properties

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ project.datadir=qz
99

1010
install.opts=-Djna.nosys=true
1111
launch.opts=-Xms512m ${install.opts}
12+
install.log=/tmp/${project.datadir}-install.log
1213
# jdk9+ flags
1314
# - Dark theme requires workaround https://github.com/bobbylight/Darcula/issues/8
1415
launch.jigsaw=--add-exports java.desktop/sun.swing=ALL-UNNAMED

0 commit comments

Comments
 (0)