I have an MS Windows application which needs new version of Wine. I have installed it locally to home-folder using PlayOnLinux.
I'm stuck with creating simple bash/dash/sh script to launch .exe application inside its folder. I tried standard pushd/popd
, cd && exec
, (cd && exec)
approach but it failed.
What I need:
Currently I'm happy with the following Python-code for wrapper script (to be placed in /usr/local/bin/wine32-wrapper):
#!/usr/bin/python3
import os
import sys
import subprocess
if len(sys.argv) >= 2:
path = sys.argv[1]
wd = os.path.dirname(path)
exec_path = ["/home/{}/.PlayOnLinux/wine/linux-x86/6.15/bin/wine".format(os.getenv('USER'), path), "{}".format(path)]
p = subprocess.run(exec_path, cwd=wd)
else:
print("\nUsage {} with one argument - full file path.".format(sys.argv[0]));
and .desktop-file (to be placed in ~/.local/share/applications/wine32.desktop), for it:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=mate-panel-launcher
Exec=wine32-wrapper %f
Name=Local Wine32-6.15
then I associate my exe-files with this wine script using Caja.
Is it possible to replace above python script with bash/dash/sh script with exactly same functionality?