Application Service Maker - Run any program as a service

I'm trying to install this on a Windows 7 64 bit machine. The program doesn't want to accept my login credentials - Error 1001. :(

Are you entering your username as 'computername\username'?

Also, does the error have a description apart from the error number? If the error is "The specified service has been marked for deletion" try rebooting your PC.
 
Are you entering your username as 'computername\username'?

Also, does the error have a description apart from the error number? If the error is "The specified service has been marked for deletion" try rebooting your PC.

Great, thank you. Got it installed. :)
 
Version 0.3 released.

I've updated the OP with the details but here's the gist:

I've added some features which I've needed since the initial release. Maybe they'll be useful to others as well.

- Duplication is now possible, i.e. you can run the same application more than once, like multiple "cmd" processes.
- You can send arguments to an application.
- You can set an application to close when you stop the service.
- You can set the logging level to minimal (only logs errors) and verbose (logs pretty much everything that happens, for troubleshooting).

Installer: https://www.box.com/s/qm8fhfygcjw4rs1zwpbf
Source: https://www.box.com/s/2a3cnb4datb2ey6878h8
 
Hey bro,

I've just installed OpenNMS, which is an Open Source Network Monitor solution. Problem is, it needs to have a stupid CMD prompt running constantly to have the web config working as it should under Windows. I'm trying to circumvent this with your application.

What I've done so far:

I've taken the .Bat file which is actually a command and created a shortcut .Bat file and exe'fied it. So it's running like this: "opennms.bat start"
The exe is the command and it points to the .bat.

It works perfect if it's not running through ASM (application service maker). I execute the exe, it launches the Batch command and I wait for the web app to load.

As soon as I start ASM though, I get no joy. This is my config for ASM:

</setting>
<setting name="ApplicationList" serializeAs="String">
<value>{OpenNMS;C:\Program Files\OpenNMS\bin\opennms.exe}</value>
</setting>


Any idea what I'm doing wrong?
 
Hey ya,

Make sure that verbose logging is active with
Code:
<setting name="LoggingMode" serializeAs="String">
    <value>V</value>
</setting>

and then let's see what the event viewer says. It should be able to tell us why the application didn't start.

And also, thanks for giving the service a try :).
 
Thanks for the help,

Here's the event viewer logs:

Code:
An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.InitializeServiceData. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section userSettings/setting. (C:\Program Files (x86)\Blaq Entertainment\Application Service Maker\ApplicationService.exe.Config line 9) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.RefreshConfig(String sectionName) at System.Configuration.ConfigurationManager.RefreshSection(String sectionName) at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped) at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) at System.Configuration.SettingsBase.get_Item(String propertyName) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at ApplicationService.Settings.get_ApplicationList() at ApplicationService.ServiceStartApplications.GetApplications() at ApplicationService.ServiceStartApplications.InitializeServiceData()


Code:
An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.OnStart. System.NullReferenceException: Object reference not set to an instance of an object. at ApplicationService.ServiceStartApplications.OnStart(String[] args)
 
That looks nasty :D.

Please post the full contents of your config file?
 
There we go :)

Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, 

Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="ApplicationService.Settings" type="System.Configuration.ClientSettingsSection, System, 

Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" 

requirePermission="false" />
        </sectionGroup>
    </configSections>
    <userSettings>
<setting name="LoggingMode" serializeAs="String">
    <value>V</value>
</setting>
        <ApplicationService.Settings>
            <setting name="TimerIntervalMinutes" serializeAs="String">
                <value>20</value>
            </setting>
            <setting name="ApplicationList" serializeAs="String">
                <value>{OpenNMS;C:\Program Files\OpenNMS\bin\opennms.exe}</value>
            </setting>
        </ApplicationService.Settings>
    </userSettings>
</configuration>

Windows 7 64 Bit. Kaspersky Endpoint Security 10.
 
Some line breaks were added to that configuration, replace with this and let me know how it goes:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="ApplicationService.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <userSettings>
<setting name="LoggingMode" serializeAs="String">
    <value>V</value>
</setting>
        <ApplicationService.Settings>
            <setting name="TimerIntervalMinutes" serializeAs="String">
                <value>20</value>
            </setting>
            <setting name="ApplicationList" serializeAs="String">
                <value>{OpenNMS;C:\Program Files\OpenNMS\bin\opennms.exe}</value>
            </setting>
        </ApplicationService.Settings>
    </userSettings>
</configuration>
 
No joy,

Event viewer logs:

Code:
An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.OnStart. System.NullReferenceException: Object reference not set to an instance of an object. at ApplicationService.ServiceStartApplications.OnStart(String[] args)

Code:
 An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.InitializeServiceData. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unexpected end of file has occurred. The following elements are not closed: configuration. Line 20, position 16. (C:\Program Files (x86)\Blaq Entertainment\Application Service Maker\ApplicationService.exe.Config line 20) ---> System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: configuration. Line 20, position 16. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ThrowUnclosedElements() at System.Xml.XmlTextReaderImpl.ParseEndElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction action) at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps) at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps) at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil) at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() --- End of inner exception stack trace --- at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.RefreshConfig(String sectionName) at System.Configuration.ConfigurationManager.RefreshSection(String sectionName) at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped) at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) at System.Configuration.SettingsBase.get_Item(String propertyName) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at ApplicationService.Settings.get_ApplicationList() at ApplicationService.ServiceStartApplications.GetApplications() at ApplicationService.ServiceStartApplications.InitializeServiceData()
 
Apologies, the LoggingMode setting was also in the wrong place, try this rather:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="ApplicationService.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <userSettings>
        <ApplicationService.Settings>
            <setting name="TimerIntervalMinutes" serializeAs="String">
                <value>20</value>
            </setting>
            <setting name="ApplicationList" serializeAs="String">
                <value>{OpenNMS;C:\Program Files\OpenNMS\bin\opennms.exe}</value>
            </setting>
	    <setting name="LoggingMode" serializeAs="String">
		<value>V</value>
	    </setting>
        </ApplicationService.Settings>
    </userSettings>
</configuration>
 
Still no joy:

Code:
An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.OnStart. System.NullReferenceException: Object reference not set to an instance of an object. at ApplicationService.ServiceStartApplications.OnStart(String[] args)

Code:
An error has occured in the application ApplicationService. Error Location: ServiceStartApplications.InitializeServiceData. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Data at the root level is invalid. Line 1, position 1. (C:\Program Files (x86)\Blaq Entertainment\Application Service Maker\ApplicationService.exe.Config line 1) ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Configuration.XmlUtil..ctor(Stream stream, String name, Boolean readToFirstElement, ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() --- End of inner exception stack trace --- at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.RefreshConfig(String sectionName) at System.Configuration.ConfigurationManager.RefreshSection(String sectionName) at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped) at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) at System.Configuration.SettingsBase.get_Item(String propertyName) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at ApplicationService.Settings.get_ApplicationList() at ApplicationService.ServiceStartApplications.GetApplications() at ApplicationService.ServiceStartApplications.InitializeServiceData()
 
Think the problem is this: "Object reference not set to an instance of an object."

Something that doesn't exist is being referenced...
 
I think the problem is when I just launch the batch file it opens cmd.exe and that's it. It's not a process on it's own. How do you actually run that as a service? Am I correct?
 
Think the problem is this: "Object reference not set to an instance of an object."

Something that doesn't exist is being referenced...

Yes and I think it's something missing in the config file.

Tera I'll debug shortly with your config and provide the fix.
 
I think the problem is when I just launch the batch file it opens cmd.exe and that's it. It's not a process on it's own. How do you actually run that as a service? Am I correct?

My program is breaking before it even launches your batch file, that's why I'm thinking it has to do with the config.
 
Weird, it's "working" on my side, error I'm getting is that it can't find opennms.exe.

I think something is breaking the config file in your environment, so I've uploaded the one I tested with to https://app.box.com/s/aeb9seuw1nwnpm69v5x7. Download and copy it to the install directory without opening it and test?
 
Good morning,

Thank you. That did the trick with the Event Log errors, but my App is still not launching. Any ideas?
 
Good morning,

Thank you. That did the trick with the Event Log errors, but my App is still not launching. Any ideas?

Does the event viewer not give any error at all about launching the app? So it says that OpenNMS was successfully launched?
 
Does the event viewer not give any error at all about launching the app? So it says that OpenNMS was successfully launched?

It says:
Attempting to start application: OpenNMS (C:\Program Files\OpenNMS\bin\opennms.exe)

It doesn't stop or give an error after this though?
 
Top
Sign up to the MyBroadband newsletter
X