<div dir="ltr">Yes, forgot to mention that - also, the Microsoft*.dll form the IronPython 2.0 directory are in C:\Temp\yyy\<br clear="all"><br>Chevy Chase &nbsp;- &quot;Parrots make great pets. They have more personality than goldfish.&quot;
<br><br><div class="gmail_quote">On Sat, Dec 13, 2008 at 4:57 PM, Michael Foord <span dir="ltr">&lt;<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Guy Rozendorn wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Include them where?<br>
<br>
Let&#39;s look at the following example:<br>
bar.py only has one line: print dir()<br>
I compile using pyc.py to bar.dll and bar.exe<br>
I place bar* and IronPyhton*.dll in C:\Temp\yyy\<br>
</blockquote>
<br></div>
What about the Microsoft.Scripting etc dlls - are you including those?<br><font color="#888888">
<br>
Michael<br>
<br>
</font><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
If I execute bar.exe from insdie C:\Temp\yyy, it runs without problems. here&#39;s the output:<br>
C:\Temp\yyy\<br>
bar.exe<br>
[&#39;__builtins__&#39;, &#39;__file__&#39;, &#39;__name__&#39;]<br>
<br>
But, if I try to execute bar.exe from any other directory (for example, C:\Temp\), it fails:<br>
C:\Temp\<br>
yyy\bar.exe<br>
<br>
Unhandled Exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)<br>
 &nbsp; at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)<br>
 &nbsp; at System.Reflection.Assembly.LoadFile(String path)<br>
 &nbsp; at PythonMain.Main()<br>
<br>
====<br>
<br>
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?<br>
<br>
<br></div><div><div></div><div class="Wj3C7c">
On Sat, Dec 13, 2008 at 4:43 PM, Michael Foord &lt;<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a> &lt;mailto:<a href="mailto:fuzzyman@voidspace.org.uk" target="_blank">fuzzyman@voidspace.org.uk</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;Guy Rozendorn wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I&#39;m using the IronPython 2.0, final version, and the<br>
 &nbsp; &nbsp; &nbsp; &nbsp;corresponding pyc.py<br>
<br>
 &nbsp; &nbsp;Well, in which case you need to include *all* the IronPython<br>
 &nbsp; &nbsp;assemblies and not just IronPython.dll and IronPythonModules.dll.<br>
<br>
 &nbsp; &nbsp;All the best,<br>
<br>
 &nbsp; &nbsp;Michael Foord<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and they both reside in C:\Temp\myProg.exe, along with<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IronPython.dll and IronPythonModules.dll<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; It looks like you are using the Pyc.py sample with<br>
 &nbsp; &nbsp; &nbsp; &nbsp;IronPython 1.<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Can you update to IronPython 2 and try again.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thanks<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Michael Foord<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If I try to execute myProg.exe from any other directory<br>
 &nbsp; &nbsp; &nbsp; &nbsp;(i.e -<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I&#39;m in C:\Windows, and running C:\Temp\myProg.exe), I<br>
 &nbsp; &nbsp; &nbsp; &nbsp;get the<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; following error:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Unhandled Exception: System.IO.FileNotFoundException: The<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system cannot find the file specified. (Exception from<br>
 &nbsp; &nbsp; &nbsp; &nbsp;HRESULT<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 0x80070002)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; at System.Reflection.Assembly.nLoadFile(String path,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Evidence evidence)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; at System.Reflection.Assembly.LoadFile(String path)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; at PythonMain.Main()<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; What do I need to do to make myProg.exe run from anywhere?<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Specfically, this bothers me because in deploying Windows<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Services wriiten in IronPython.<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Let&#39;s say I just compiled myService.exe, along with<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myService.dll, and they&#39;re both in C:\Temp (along with<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IronPython DLLs).<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; After I register the service, it fails to start, since the<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; current directory of the services.exe (who executes<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myService.exe) is %SystemRoot%\system32<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If I put myService.dll in the system32 directory, the<br>
 &nbsp; &nbsp; &nbsp; &nbsp;service<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; works.<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; But I don&#39;t want to put myService.dll in system32 (and many<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; more dlls that I use).<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; So, my question is:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * Can I make the magic that will cause<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myService.exe/myProg.exe to look for its DLL inside the<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; directory in which he resides in (and not the current<br>
 &nbsp; &nbsp; &nbsp; &nbsp;directory)?<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * It is possible to include myService.dll and<br>
 &nbsp; &nbsp; &nbsp; &nbsp;IronPython.dll<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and IronPythonModules.dll inside myService.exe (so I<br>
 &nbsp; &nbsp; &nbsp; &nbsp;could do<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import sys and then append to path which ever directries I<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wish for)?<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thanks,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Guy<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; ------------------------------------------------------------------------<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Users mailing list<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;&gt;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- &nbsp; &nbsp;<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a><br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Users mailing list<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br></div></div><div class="Ih2E3d">
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;&gt;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Users mailing list<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; <br>
<br>
<br>
 &nbsp; &nbsp;--  &nbsp; &nbsp;<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
 &nbsp; &nbsp;<a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a><br>
<br>
<br>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;Users mailing list<br>
 &nbsp; &nbsp;<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<br>
 &nbsp; &nbsp;<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp;<br>
</div></blockquote><div><div></div><div class="Wj3C7c">
<br>
<br>
-- <br>
<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
<a href="http://www.voidspace.org.uk/blog" target="_blank">http://www.voidspace.org.uk/blog</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br></div>