<div dir="ltr"><div class="gmail_quote">On Thu, Jan 13, 2011 at 2:25 AM, P.J. Eby <span dir="ltr">&lt;<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">At 09:31 PM 1/12/2011 +0200, cool-RR wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
I made a release of my project today, and now I see there&#39;s something wrong with it.<br>
<br>
When you install it on Windows using the windows binaries (that I made with `bdist_msi` under Python 2.7), the .exe scripts in the &quot;Scripts&quot; folder don&#39;t work. When you launch them, nothing happens. You can launch the associated *-script.pyw files and those *do* work.<br>

<br>
I investigated a little and possibly I figured it out. The shebang line says &quot;#!c:\Python27\pythonw.exe&quot;. This is the interpreter with which I *created* the binaries. But why should it be the interpreter with which the *user* works? The user could have &quot;c:\Python26\pythonw.exe&quot; as his interpreter or &quot;c:\Programs\Python25\pythonw.exe&quot; or &quot;g:\Pypy\pypy.exe&quot; as his interpreter.<br>

<br>
I tried editing the shebang line with notepad, and this caused the exe files to start working! (Of course this is not a real solution, I can&#39;t ask my users to do that.)<br>
<br>
Is this a bug in distribute?<br>
</blockquote>
<br></div>
It&#39;s a limitation of setuptools+bdist_msi - when you build a bdist_wininst, setuptools writes a generic #! line, but when you build a bdist_msi, it doesn&#39;t realize you&#39;re building a distribution.</blockquote>
<div><br></div><div>So which project exactly is responsible for this limitation? Distribute?</div><div><br></div><div>Do you think there&#39;s a good reason not to have the MSI put the path to python.exe itself into the shebang upon installation? </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;d appreciate if you can reply soon since I already started the release process and I don&#39;t want to confuse users.<br>
</blockquote>
<br></div>
As a quick workaround, you could try setting sys.executable to &#39;pythonw.exe&#39; in your setup.py, *before* setuptools is imported, then build the .msi.<br></blockquote><div><br></div><div>I&#39;d be reluctant to do that, since many users don&#39;t have the Python folder on their PATH, so it won&#39;t work for them at all.</div>
<div><br></div><div><br></div><div>Ram.</div></div>
</div>