I have a windows service that will be deployed on a few systems. I would like to get the installation path of where the user installed the service. I’m trying to get the installation path so I know where to read custom config files from. What is the proper way of doing this? I tried using Assembly.GetExecutingAssembly().Location but returned the full path and executable.
Any advice would be greatly appreciated.
Thanks!
Extract the directory name from the assembly’s location: