Installation folder

BlackByte

Well-known member
Joined
Jun 29, 2008
Messages
126
Location
South Africa, Durban
Programming Experience
1-3
Hi everyone can someone help me with a code that will detect where the user has installed the program, I want certain files to be saved in the installation directory of the program. Thnx
 
Here's a scrap of code I use in one of my services to set the working directory to be equal to the location of the exe that is running:

// Define working directory (For a service, this is set to System dir by default...)
Directory.SetCurrentDirectory(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));
 
Back
Top