Top-level wrapper script to do the environment setup.
This sets up $WIX and $LD_PRELOAD before running a Wix .NET executable via mono, so the user doesn't have to have pre-prepared those variables (and, in particular, libpreload doesn't uncontrolledly affect loads of other stuff too).
This commit is contained in:
parent
ad56c28a70
commit
e8d91ad369
1 changed files with 22 additions and 0 deletions
22
wrapper.py
Executable file
22
wrapper.py
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
def addtopath(val, varname):
|
||||||
|
newvar = val
|
||||||
|
if varname in os.environ:
|
||||||
|
if val in os.environ[varname].split(":"):
|
||||||
|
return # already there
|
||||||
|
newvar += ":" + os.environ[varname]
|
||||||
|
os.environ[varname] = newvar
|
||||||
|
|
||||||
|
scriptname = os.path.basename(sys.argv[0])
|
||||||
|
wixdir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
addtopath(os.path.join(wixdir, "libpreload.so"), "LD_PRELOAD")
|
||||||
|
|
||||||
|
os.environ["WIX"] = wixdir
|
||||||
|
|
||||||
|
dotnet_exe = os.path.join(wixdir, scriptname + ".exe")
|
||||||
|
os.execvp("/usr/bin/mono", ["mono", dotnet_exe] + sys.argv[1:])
|
Loading…
Add table
Reference in a new issue