I want to set up a user account for a Windows service even before installation. I do this by adding code to the project installer.
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.User; this.serviceProcessInstaller1.Password = ConfigurationSettings.AppSettings ["password"]; this.serviceProcessInstaller1.Username = ConfigurationSettings.AppSettings ["username"];
Username and password are still requested. It seems that the configuration file is not being prepared by the time the installation is complete.
How can I pull the username and password from the configuration file, rather than hardcoding?
source share