Skip to content

Commit

Permalink
Made Password writable in BeforeInstall
Browse files Browse the repository at this point in the history
I want to modify the Password in the BeforeInstall event.
Just making it writable as suggested did not work because
HostServiceInstaller is created with command line passed Password
already and then only the BeforeInstall is called. So it is too late to
just set the new Password in BeforeInstall?

See https://groups.google.com/forum/#!topic/topshelf-discuss/4iBCSS0WW4c
  • Loading branch information
Kobus-Smit authored and phatboyg committed May 3, 2016
1 parent 6b44d18 commit bfcdf25
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Topshelf/Configuration/Credentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Credentials(string username, string password, ServiceAccount account)
}

public string Username { get; private set; }
public string Password { get; private set; }
public string Password { get; set; }
public ServiceAccount Account { get; private set; }
}
}
1 change: 1 addition & 0 deletions src/Topshelf/Hosts/InstallHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public string Username
public string Password
{
get { return _credentials.Password; }
set { _credentials.Password = value; }
}

public string[] Dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/Topshelf/Runtime/InstallHostSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface InstallHostSettings :
ServiceAccount Account { get; }

string Username { get; }
string Password { get;}
string Password { get; set; }

string[] Dependencies { get; }

Expand Down

0 comments on commit bfcdf25

Please sign in to comment.