Retrieve Installation Path
-
Hi, i've created a setup project and it works fine. Now i want to retrieve the installation path because i need to set it as current directory for the windows service i've created. How can i do it? I need to pass through windows registry (how?) or exists a variable or a property which i can read? Thank you all! Gianluca
-
Hi, i've created a setup project and it works fine. Now i want to retrieve the installation path because i need to set it as current directory for the windows service i've created. How can i do it? I need to pass through windows registry (how?) or exists a variable or a property which i can read? Thank you all! Gianluca
-
Hi, i've created a setup project and it works fine. Now i want to retrieve the installation path because i need to set it as current directory for the windows service i've created. How can i do it? I need to pass through windows registry (how?) or exists a variable or a property which i can read? Thank you all! Gianluca
terrible83 wrote:
because i need to set it as current directory for the windows service i've created
As someone pointed out in the past few days, best practice is to use absolute paths. To obtain the path you can access the installation path using the Windows Installer SDK in your service, that is what you are asking correct? However AFAIK this should work:
System.Reflection.Assembly.GetExecutingAssembly().Location