[IronPython] Questions about compiled .py files - their stub exe and dlls
fuzzyman at voidspace.org.uk
Sat Dec 13 06:26:28 PST 2008
Guy Rozendorn wrote:
> I have a question about compiled python files with the pyc.py example.
> I read that the dll must exist from the directory from which the
> executable is executed.
> For example, let's say I compiled my code to:
> and they both reside in C:\Temp\myProg.exe, along with IronPython.dll
> and IronPythonModules.dll
It looks like you are using the Pyc.py sample with IronPython 1. Can you
update to IronPython 2 and try again.
> If I try to execute myProg.exe from any other directory (i.e - I'm in
> C:\Windows, and running C:\Temp\myProg.exe), I get the following error:
> Unhandled Exception: System.IO.FileNotFoundException: The system
> cannot find the file specified. (Exception from HRESULT
> : 0x80070002)
> at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)
> at System.Reflection.Assembly.LoadFile(String path)
> at PythonMain.Main()
> What do I need to do to make myProg.exe run from anywhere?
> Specfically, this bothers me because in deploying Windows Services
> wriiten in IronPython.
> Let's say I just compiled myService.exe, along with myService.dll, and
> they're both in C:\Temp (along with IronPython DLLs).
> After I register the service, it fails to start, since the current
> directory of the services.exe (who executes myService.exe) is
> If I put myService.dll in the system32 directory, the service works.
> But I don't want to put myService.dll in system32 (and many more dlls
> that I use).
> So, my question is:
> * Can I make the magic that will cause myService.exe/myProg.exe to
> look for its DLL inside the directory in which he resides in (and not
> the current directory)?
> * It is possible to include myService.dll and IronPython.dll and
> IronPythonModules.dll inside myService.exe (so I could do import sys
> and then append to path which ever directries I wish for)?
> Users mailing list
> Users at lists.ironpython.com
More information about the Users