Skip to content

Commit

Permalink
Current directory problem associated with DYAPPs discussed
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Sep 20, 2018
1 parent 5fc8fea commit 01dbb2c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
16 changes: 8 additions & 8 deletions HTML/13-Windows-Services.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ <h3>Table of contents</h3>
</ul>
</div>
</nav>
<table style="font-size:xx-large;color:red;">
<tbody>
<tr>
<td><strong> This chapter needs attention due to the move to version 17.0!! </strong></td>
</tr>
</tbody>
</table>
<div class="h_tag">
<a href="#Windows-Services" id="Windows-Services" class="autoheader_anchor">
<h1>Windows Services</h1>
Expand Down Expand Up @@ -140,10 +133,17 @@ <h3>DYALOG_NOPOPUPS</h3>
<h2>Uninstalling a service</h2>
</a>
</div>
<p>To uninstall the Service, simply open a console window with <em>Run as administrator</em> and enter:</p>
<p>To uninstall the Service, simply open a console window with <em>Run as administrator</em>, navigate to the directory the <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr> lives in and then enter:</p>
<pre><code>sc delete MyAppService</code></pre>
<p>and you are done.</p>

<div class="leanpub_A">
<h3>Why is changing the current directory required?</h3>
<p>When you double-click a <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr> the script is executed with the directory the script lives in defining what will become the current directory from the <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr>'s point of view.</p>
<p>When you call a <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr> the current directory is defined by the directory you call the <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr> from. If that is different from where the <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr> lives then statements like <code>Load ..\apltree\APLTreeUtils</code> will fail because they are relative to the current directory. That's why you must change the current directory first.</p>
<p>At the time of writing one cannot set the current directory from within a <abbr title="File with the extension 'dyapp' that contains 'Load' and 'Run' commands in order to put together an APL application">DYAPP</abbr>. Hopefully this restriction will be lifted soon.</p>
</div>

<div class="leanpub_A">
<h3>Pitfalls when installing or uninstalling Windows Services</h3>
<p>When you have opened the <em>Services</em> GUI while installing or uninstalling a Windows Service you must press F5 on the GUI to refresh the display.</p>
Expand Down
2 changes: 1 addition & 1 deletion code/v13/Install_Service.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode\dyalogrt.exe" "%~dp0\MyAppService.DWS" APL_ServiceInstall=MyAppService DYALOG_NOPOPUPS=1 MAXWS=64MB APLCORENAME=D:\AAA\KaisAplcores_*
"C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode\dyalogrt.exe" "%~dp0\MyAppService.DWS" APL_ServiceInstall=MyAppService DYALOG_NOPOPUPS=1 MAXWS=64MB
2 changes: 1 addition & 1 deletion code/v13/MyAppService/Install_Service.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode\dyalogrt.exe" "%~dp0\MyAppService.DWS" APL_ServiceInstall=MyAppService DYALOG_NOPOPUPS=1 MAXWS=64MB APLCORENAME=D:\AAA\KaisAplcores_*
"C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode\dyalogrt.exe" "%~dp0\MyAppService.DWS" APL_ServiceInstall=MyAppService DYALOG_NOPOPUPS=1 MAXWS=64MB
Binary file modified code/v13/MyAppService/MyAppService.dws
Binary file not shown.
14 changes: 9 additions & 5 deletions manuscript/13-Windows-Services.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{:: encoding="utf-8" /}
[parm]:title = 'Services'


|** This chapter needs attention due to the move to version 17.0!! **|{style="font-size:xx-large;color:red;"}

# Windows Services


Expand Down Expand Up @@ -83,14 +79,22 @@ This also prevents the _Service MyAppService successfully installed_ message fro

## Uninstalling a service

To uninstall the Service, simply open a console window with _Run as administrator_ and enter:
To uninstall the Service, simply open a console window with _Run as administrator_, navigate to the directory the DYAPP lives in and then enter:

~~~
sc delete MyAppService
~~~

and you are done.

A> # Why is changing the current directory required?
A>
A> When you double-click a DYAPP the script is executed with the directory the script lives in defining what will become the current directory from the DYAPP's point of view.
A>
A> When you call a DYAPP the current directory is defined by the directory you call the DYAPP from. If that is different from where the DYAPP lives then statements like `Load ..\apltree\APLTreeUtils` will fail because they are relative to the current directory. That's why you must change the current directory first.
A>
A> At the time of writing one cannot set the current directory from within a DYAPP. Hopefully this restriction will be lifted soon.

A> # Pitfalls when installing or uninstalling Windows Services
A>
A> When you have opened the _Services_ GUI while installing or uninstalling a Windows Service you must press F5 on the GUI to refresh the display.
Expand Down

0 comments on commit 01dbb2c

Please sign in to comment.