private void runInstallutil( WindowsService service, bool uninstall )
{
try {
EwlStatics.RunProgram(
EwlStatics.CombinePaths( RuntimeEnvironment.GetRuntimeDirectory(), "installutil" ),
( uninstall ? "/u " : "" ) + "\"" +
EwlStatics.CombinePaths( GetWindowsServiceFolderPath( service, true ), service.NamespaceAndAssemblyName + ".exe" /* file extension is required */ ) + "\"",
"",
true );
}
catch( Exception e ) {
const string message = "Installer tool failed.";
if( e.Message.Contains( typeof( EmailSendingException ).Name ) )
throw new UserCorrectableException( message, e );
throw new ApplicationException( message, e );
}
}