summarylogtreecommitdiffstats
path: root/pandownload-wrapper
blob: 2f11e2e45af55343586e18eaa2439876342623a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/sh


set -ue

pd_dir="$HOME"/.local/share/pandownload
export WINEARCH=win32 WINEPREFIX="${pd_dir}"/wine
export WINEDEBUG=-all WINEDLLOVERRIDES="mscoree,mshtml="

if [ ! -d "${pd_dir}" ] ; then
  mkdir -p "${pd_dir}"{,/wine}
  ln -s /opt/pandownload/PanDownload.exe "${pd_dir}"/pandownload.exe
  ln -s /opt/pandownload/libcurl.dll "${pd_dir}"/libcurl.dll
  ln -s /opt/pandownload/lua53.dll "${pd_dir}"/lua53.dll
  cp -r /opt/pandownload/PanData "${pd_dir}"/PanData

  wineboot -u
  ln -sf /opt/pandownload/wine/msscript.ocx "${pd_dir}"/wine/drive_c/windows/system32/msscript.ocx
  wine regedit /S /opt/pandownload/wine/override-dll.reg
fi

exec wine "${pd_dir}"/pandownload.exe "$@"