Link to home
Start Free TrialLog in
Avatar of StanT
StanTFlag for United States of America

asked on

Specify installation directory.

Hi Experts,

I was wondering how to tell a program to look in the installation directory for a file.

Glass.WriteXmlSchema("INSTALLATION PATH"\DemoSchema.xsd")

Thanks, Stan
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

Use the Assembly information & the Directory Info
Imports System.IO
Imports System.Reflection
 
Public Sub Foo()
  Dim executingPath As DirectoryInfo = New FileInfo(Assembly.GetEntryAssembly().Location).Directory
  Dim schemaName As String = "DemoSchema.xsd"
  Dim schemaPath As String = executingPath & "\" & schemaName
End Sub
sibg

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of StanT

ASKER

Thanks, that worked....although I ended up going with a different route. I placed all my files on a server share. That way I don't have to recompile everytime i needed to change a form.