<div dir="ltr"><div><span style="line-height:1.5">On Mon, May 30, 2016 at 11:49 PM John R. Ashmun <<a href="mailto:john.ashmun@gmail.com">john.ashmun@gmail.com</a>> wrote:</span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Now, running under R18.2 and Windows 10, I get a popup error message window that says<br><br></div>"Werl<br><br></div>Failed to execute erl: The system cannot find the file specified."<br><br></div>unless the current directory for the command prompt is "c:\Program Files\erl7.3\erts-7.3\bin".<br><br>This is really similar to the restriction that Danial Goertzen pointed out about R15 albeit with an error message about a different file that's in ...\erts-(Vsn)\bin. Could werl be changed to look in the directory near its own location rather than the current directory? Further, it appears that erl.exe and werl.exe are each duplicated between ..\erl7.3\bin and ..erl7.3\erts-7.3\bin, for what purpose I am unsure, yet if werl were able to find itself, it could certainly find erl.exe.<br></div><div><br>When the current directory is set to ..\erts-7.3\bin and I enter<br><br></div></div><div dir="ltr"><div>werl -detached -run wx demo<br><br></div></div><div dir="ltr"><div>the demo runs admirably, but after I close its window, a Windows process "erl" continues to run. Doubtless this is the detached VM, but how do I explain to naive game users its continuation and the need to stop it using, e.g., Task Manager?<br><br></div><div>These startup questions have led me to the init module and its boot/1 and stop/0 & stop/1 functions. I think I would like my release's init process to call stop( ) when my game stops. Is there a handy example of the use of init:stop( )?<br><br></div></div></blockquote><div><br></div><div><div style="font-size:13px"><span style="line-height:1.5">Calling erlang:halt() will halt the erlang machine, but we can not call that for obvious reasons in wx demo.</span><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>Regards,<br></div><div>John Ashmun<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 25, 2016 at 1:22 PM, Dan Gudmundsson <span dir="ltr"><<a href="mailto:dangud@gmail.com" target="_blank">dangud@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hmm,<div>It works fine for me on Windows 10 from msys2 with erlang in the path <div>and from cmd shell without erlang in the path:<div><br></div><div><div>C:\Users\familjen>"c:\Program Files (x86)\erl7.3\bin\werl" -run wx demo</div><div><br></div><div>C:\Users\familjen>"c:\Program Files (x86)\erl7.3\bin\werl" -detached -run wx demo</div><div><br></div><div>Oh noticed the version you are running...</div><div><br></div><div>It also works for me with 17.0 i.e. erl-6.0 which is the oldest I have installed here at home.</div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Why are you using an old version of erlang?</span><br></div></div></div></div><div><span style="line-height:1.5">Can you try a newer version and see if that works?</span><br></div><div><br></div></div><div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 25, 2016 at 9:49 PM John Ashmun <<a href="mailto:john.ashmun@gmail.com" target="_blank">john.ashmun@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I just found time to try what you suggested with the wx demo, but I got the same pop up Windows error message as when I try to run my release with -detached.</div><div><br></div><div>I added ...\erts-5.9\bin to %Path% and tried again but it failed again with the same error message.<br><br>Sent from my iPhone</div></div><div dir="auto"><div><br>On May 18, 2016, at 12:02 AM, Dan Gudmundsson <<a href="mailto:dangud@gmail.com" target="_blank">dangud@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>At least this works as it should:</div><div><br></div>werl -detached -run wx demo <div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 18, 2016 at 3:48 AM John R. Ashmun <<a href="mailto:john.ashmun@gmail.com" target="_blank">john.ashmun@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 6:32 PM, zxq9 <span dir="ltr"><<a href="mailto:zxq9@zxq9.com" target="_blank">zxq9@zxq9.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tuesday 17 May 2016 16:47:35 John R. Ashmun wrote:<br>
> Perhaps my subject is not quite the correct question. Here's my context:<br>
><br>
> I'm beginning to recreate in Erlang on Microsoft Windows 10 a public domain<br>
> program I used to enjoy on my Commodore Amiga: mATC was a game in which<br>
> the user acted as a military Air Traffic Controller. I am using a wx<br>
> window to draw the player's map with aircraft data blocks overlaid. I<br>
> don't have a use for the initial window that opens when werl is started.<br>
<br>
</span>Awesome!<br>
<span><br>
> If I use this Command Prompt batch file, mATC.bat:<br>
><br>
> werl -pa ebin -pa mATC_app\ebin -detached -boot mATC -config sys<br>
><br>
> a Windows error message window appears that says:<br>
><br>
> "Failed to execute C:\Program Files\erl5.9\erts5.9\bin\beam.smp.dll<br>
> The system cannot find the file specified."<br>
><br>
> The DLL is actually present at that location, and of course everything runs<br>
> well when I don't use -detached.<br>
<br>
</span>Hrm... that seems odd, but I have to admit I have no experience running<br>
actual releases on Windows. What I usually do instead is have the runtime<br>
installed on the Windows machine, unpack project code and kick things off<br>
with an escript that builds and then launches the code I want to run.<br>
<br>
Changing from releases to from-source build->run may require a bit of<br>
shuffling -- and may or may not be worth it depending on the project.<br>
But this has been very effective and lightweight for my purposes.<br>
<br>
Like everything else on Windows there are a few quirks to making escripts<br>
a click-to-run experience (specifying full path to "escript.exe" instead<br>
of "escript" in your launcher, space for unheeded shebang, etc.). I've<br>
wanted for a few years now to formalize and simplify a solution to this...<br>
but real life gets in the way of the things I wish I could do as community<br>
project work. :-(<br>
<br>
The escript-to-bootstrap approach has made my Erlang GUI experience on<br>
Windows fairly painless -- I can develop on Linux or BSD and almost always<br>
get away with relying on anything that works there (to include wx) working<br>
pretty much the same way on Windows.<br>
<br>
I have not tried this on Windows 10 yet, but I assume it will continue to<br>
work the same way it does on Windows 7 and 8.1.<br>
<br>
-Craig<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div></div><div dir="ltr"><div class="gmail_extra">I will look into escript, thanks.<br><br></div></div><div dir="ltr"><div class="gmail_extra">John<br></div></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>
</div></blockquote></div></blockquote></div>
</div></div></blockquote></div><br></div>
</blockquote></div></div>