-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
pre-install
executable file
·121 lines (107 loc) · 4.94 KB
/
pre-install
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
#!/bin/bash
# acrordrdc env
progHome="$WINEPREFIX/drive_c/Program Files/Adobe/Acrobat Reader DC/Reader"
progBin="AcroRd32.exe"
progSetup="$WINEPREFIX/drive_c/Program Files/Adobe/Acrobat Reader DC/Setup Files/{AC76BA86-7AD7-1033-7B44-AC0F074E4100}"
prefixFont="$WINEPREFIX/drive_c/windows/Fonts"
$WINETRICKS --unattended mspatcha riched20 vcrun2015
INSTALL_URL_DE="https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2001320064/AcroRdrDC2001320064_de_DE.exe"
INSTALL_URL_US="https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2001320064/AcroRdrDC2001320064_en_US.exe"
INSTALL_URL_ES="https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2001320064/AcroRdrDC2001320064_es_ES.exe"
INSTALL_URL_FR="https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2001320064/AcroRdrDC2001320064_fr_FR.exe"
INSTALL_URL_JP="https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2001320064/AcroRdrDC2001320064_ja_JP.exe"
if [[ ! -f "$prefixFont/Segoe UI.ttf" ]]; then
mkdir -p "$prefixFont"
( cd "$prefixFont"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf" -O "Segoe UI.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf" -O "Segoe UI Semibold.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf" -O "Segoe UI Bold.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf" -O "Segoe UI Semibold.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf" -O "Segoe UI Light.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf" -O "Segoe UI Semilight.ttf"
wget --no-check-certificate -q "c.s-microsoft.com/static/fonts/segoe-ui/west-european/italic/latest.ttf" -O "Segoe UI Italic.ttf" )
fi
function install() {
# Downloads a file with progress using wget and yad
wget "${INSTALL_URL}" -O "${TMPDIR}/${INSTALL_EXE}" 2>&1 | \
perl -p -e '$| = 1; s/^.* +([0-9]+%) +([0-9,.]+[GMKB]) +([0-9hms,.]+).*$/\1\n# Downloading... \2 (\3)/' | \
yad --progress --title="${INSTALL_EXE}" --width=400 --center --no-buttons --auto-close --auto-kill --on-top --no-escape
# Unpack setup files
7z x "${TMPDIR}/${INSTALL_EXE}" -o"${TMPDIR}/dl"
# Installs the application
wine "${TMPDIR}/dl/setup.exe" /sAll
# Apply reg
wget --no-check-certificate -q https://gist.github.com/mmtrt/896cf131e3956b23e8e47a5a52f58b01/raw/097cbd0eeb836d69a84423aaef9a7ead2840a111/acrordr -P ${TMPDIR} && wine regedit ${TMPDIR}/acrordr && rm ${TMPDIR}/acrordr
# set prefix os to xp
$WINETRICKS --unattended winxp
# Rename some files which are going rouge on closing acrordr
cd "$WINEPREFIX/drive_c/Program Files/Common Files/Adobe/ARM/1.0"
mv armsvc.exe armsvc.exe_disabled
mv AdobeARM.exe AdobeARM.exe_disabled
mv AdobeARMHelper.exe AdobeARMHelper.exe_disabled
cd "$progHome/AcroCEF"
mv RdrServicesUpdater.exe RdrServicesUpdater.exe_disabled
mv RdrCEF.exe RdrCEF.exe_disabled
# Remove the cached installers & files
rm -v "${TMPDIR}/${INSTALL_EXE}" 2>/dev/null
rm -rf "${TMPDIR}/dl" 2>/dev/null
rm -rf "${TMPDIR}/winetricks" 2>/dev/null
}
function install_de() {
# Modify or remove this as required by your application.
if [ -n "${INSTALL_URL_DE}" ]; then
INSTALL_URL="${INSTALL_URL_DE}"
INSTALL_EXE=$(basename "${INSTALL_URL}")
install
fi
}
function install_es() {
# Modify or remove this as required by your application.
if [ -n "${INSTALL_URL_ES}" ]; then
INSTALL_URL="${INSTALL_URL_ES}"
INSTALL_EXE=$(basename "${INSTALL_URL}")
install
fi
}
function install_fr() {
# Modify or remove this as required by your application.
if [ -n "${INSTALL_URL_FR}" ]; then
INSTALL_URL="${INSTALL_URL_FR}"
INSTALL_EXE=$(basename "${INSTALL_URL}")
install
fi
}
function install_jp() {
# Modify or remove this as required by your application.
if [ -n "${INSTALL_URL_JP}" ]; then
INSTALL_URL="${INSTALL_URL_JP}"
INSTALL_EXE=$(basename "${INSTALL_URL}")
install
fi
}
function install_us() {
# Modify or remove this as required by your application.
if [ -n "${INSTALL_URL_US}" ]; then
INSTALL_URL="${INSTALL_URL_US}"
INSTALL_EXE=$(basename "${INSTALL_URL}")
install
fi
}
action=$(yad --width 400 --entry --title "Adobe Acrobat Reader DC" \
--center \
--width=400 \
--button="Install:0" --button="Exit:1" \
--text "Select your language for installer download:" \
--entry-text \
"English" "French" "German" "Japanese" "Spanish")
ret=$?
[[ $ret -eq 1 ]] && exit 0
case $action in
Ger*) cmd=$(install_de) ;;
Spa*) cmd=$(install_es) ;;
Fre*) cmd=$(install_fr) ;;
Jap*) cmd=$(install_jp) ;;
Eng*) cmd=$(install_us) ;;
*) exit 1 ;;
esac
eval $cmd 2>/dev/null