Including INI file in Services Deployment

  • Thread starter Thread starter Igor
  • Start date Start date
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,
 
* "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
///
 
Back
Top