Reading License File in windows Service

257 views
Skip to first unread message

Michael Cardwell

unread,
May 8, 2012, 4:25:40 PM5/8/12
to .Net Reactor Support
I am using NR 4.4.0.0 and am not able to read my license file when
using a windows service. I am able to just fine in a forms
application. I am coding in vb on visual basic 2010. Would anyone be
willing to share some code of how to do this in for a service? Thanks.

Tristan Reeves

unread,
May 9, 2012, 3:39:42 AM5/9/12
to net-react...@googlegroups.com
Hi,
I'd say it might be because when you run as a service, the working directory is sometimes system32 -- maybe it's looking for the license file there, instead of the directory that actually contains your exe. (eg http://stackoverflow.com/questions/884963/what-directory-does-a-windows-service-run-in)

Now, it seems like it's not a simple problem to overcome, especially since nr looks for the license file before you have a chance to do anything.

One solution I can think of is:
Have a "bootstrapper" program (no nr protection) that runs as a service. The whole purpose of the bootstrapper is to launch the real executable, with the CORRECT working directory.

Hope this can help you,
Tristan.




--
You received this message because you are subscribed to the Google Groups ".Net Reactor Support" group.
To post to this group, send email to net-react...@googlegroups.com.
To unsubscribe from this group, send email to net-reactor-sup...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/net-reactor-support?hl=en.


Alex

unread,
May 9, 2012, 5:39:35 AM5/9/12
to .Net Reactor Support
Hi there,

What about to load license file manually? NET Reactor Help > SDK >
License.dll > Manually load a license using a filename

/*** Load the license. ***/
public void LoadLicense(string filename)
{
License.Status.LoadLicense(filename);
}

Alex

On May 9, 10:39 am, Tristan Reeves <tree...@gmail.com> wrote:
> Hi,
> I'd say it might be because when you run as a service, the working
> directory is sometimes system32 -- maybe it's looking for the license file
> there, instead of the directory that actually contains your exe. (eghttp://stackoverflow.com/questions/884963/what-directory-does-a-windo...
> )
>
> Now, it seems like it's not a simple problem to overcome, especially since
> nr looks for the license file before you have a chance to do anything.
>
> One solution I can think of is:
> Have a "bootstrapper" program (no nr protection) that runs as a service.
> The whole purpose of the bootstrapper is to launch the real executable,
> with the CORRECT working directory.
>
> Hope this can help you,
> Tristan.
>
> On Wed, May 9, 2012 at 6:25 AM, Michael Cardwell
> <italo.cardw...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages