[IronPython] Questions about compiled .py files - their stub exe and dlls

Guy Rozendorn guy at rzn.co.il
Sat Dec 13 16:49:13 CET 2008


Yes, forgot to mention that - also, the Microsoft*.dll form the IronPython
2.0 directory are in C:\Temp\yyy\

Chevy Chase  - "Parrots make great pets. They have more personality than
goldfish."

On Sat, Dec 13, 2008 at 4:57 PM, Michael Foord <fuzzyman at voidspace.org.uk>wrote:

> Guy Rozendorn wrote:
>
>> Include them where?
>>
>> Let's look at the following example:
>> bar.py only has one line: print dir()
>> I compile using pyc.py to bar.dll and bar.exe
>> I place bar* and IronPyhton*.dll in C:\Temp\yyy\
>>
>
> What about the Microsoft.Scripting etc dlls - are you including those?
>
> Michael
>
>  If I execute bar.exe from insdie C:\Temp\yyy, it runs without problems.
>> here's the output:
>> C:\Temp\yyy\
>> bar.exe
>> ['__builtins__', '__file__', '__name__']
>>
>> But, if I try to execute bar.exe from any other directory (for example,
>> C:\Temp\), it fails:
>> C:\Temp\
>> yyy\bar.exe
>>
>> 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()
>>
>> ====
>>
>> All I want is to be able to execute the compiled python scripts from
>> whatever directory I want, and not just the directory in which the binary
>> and all assemblies are in. Is it possilble?
>>
>>
>> On Sat, Dec 13, 2008 at 4:43 PM, Michael Foord <fuzzyman at voidspace.org.uk<mailto:
>> fuzzyman at voidspace.org.uk>> wrote:
>>
>>    Guy Rozendorn wrote:
>>
>>        I'm using the IronPython 2.0, final version, and the
>>        corresponding pyc.py
>>
>>    Well, in which case you need to include *all* the IronPython
>>    assemblies and not just IronPython.dll and IronPythonModules.dll.
>>
>>    All the best,
>>
>>    Michael Foord
>>
>>
>>
>>               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.
>>
>>           Thanks
>>
>>           Michael Foord
>>
>>
>>               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 %SystemRoot%\system32
>>               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)?
>>
>>               Thanks,
>>               Guy
>>
>> ------------------------------------------------------------------------
>>
>>               _______________________________________________
>>               Users mailing list
>>               Users at lists.ironpython.com
>>        <mailto:Users at lists.ironpython.com>
>>        <mailto:Users at lists.ironpython.com
>>        <mailto:Users at lists.ironpython.com>>
>>
>>
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>           --    http://www.ironpythoninaction.com/
>>           http://www.voidspace.org.uk/blog
>>
>>
>>           _______________________________________________
>>           Users mailing list
>>           Users at lists.ironpython.com
>>        <mailto:Users at lists.ironpython.com>
>>        <mailto:Users at lists.ironpython.com
>>        <mailto:Users at lists.ironpython.com>>
>>
>>           http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>
>>  ------------------------------------------------------------------------
>>
>>        _______________________________________________
>>        Users mailing list
>>        Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>>        http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>
>>    --    http://www.ironpythoninaction.com/
>>    http://www.voidspace.org.uk/blog
>>
>>
>>    _______________________________________________
>>    Users mailing list
>>    Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>>    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081213/72d1e6cd/attachment.html>


More information about the Ironpython-users mailing list