Including INI file in Services Deployment

I

Igor

Hi, Does anybody know how to include an INI file in the
deployment of a VB.NET service? I am able to package it
as a content file so that the INI file is installed along
with the other files into the chosen directory upon
installation of the MSI. However, when i execute my API
call to the INI from within the call... the call to the
current directory: Directory.GetCurrentDirectory
& "\filename.INI"... the current directory turns out to
be c:\windows\system32 which makes sense since this is a
windows service. However, since the INI is not in this
directory, this causes an error.
Does anyone know how to overcome this issue?
Thanks heaps,
 
H

Herfried K. Wagner [MVP]

* "Igor said:
Hi, Does anybody know how to include an INI file in the
deployment of a VB.NET service? I am able to package it
as a content file so that the INI file is installed along
with the other files into the chosen directory upon
installation of the MSI. However, when i execute my API
call to the INI from within the call... the call to the
current directory: Directory.GetCurrentDirectory
& "\filename.INI"... the current directory turns out to
be c:\windows\system32 which makes sense since this is a
windows service. However, since the INI is not in this
directory, this causes an error.

Maybe this works:

\\\
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top