I have an installer class using ServiceProcessInstaller
. In the installer class in the constructor I add it to installers:
serviceProcessInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
// Add Both Installers to Project Installers Collection to be Run
Installers.AddRange(new Installer[]
{
serviceProcessInstaller,
serviceInstaller
});
and in Install method I set the username and password:
public override void Install(IDictionary stateSaver)
{
.... open the form, bla bla bla
serviceProcessInstaller.Password = accountForm.txtPassword.Text;
serviceProcessInstaller.Username = accountForm.txtServiceAccount.Text;
serviceProcessInstaller.Account = ServiceAccount.User;
}
when I try to run it however, I get the very descriptive error message: "No mapping between account names and security IDs was done". What am I doing wrong?
EDIT: I tested that this error happens only when I install this component using msi package. It works just fine when I run InstallUtil against it.