Error creating service

Answered

Comments

2 comments

  • Avatar
    wojciechka

    Is it possible a service with same name already exists?

    If your service name is common and customers may have a service with same name, you can use <getUniqueWindowsServiceName> action to generate unique display and service name. For example:

    <getUniqueWindowsServiceName> <serviceName>foo</serviceName> <displayName>My Foo service</displayName> <selectedDisplayNameVariable>newDisplayName</selectedDisplayNameVariable> <selectedServiceNameVariable>newServiceName</selectedServiceNameVariable> </getUniqueWindowsServiceName> <createWindowsService> <program>${installdir}/myService.exe</program> <programArguments></programArguments> <serviceName>${newServiceName}</serviceName> <displayName>${newDisplayName}</displayName> <startType>auto</startType> <description>My Service</description> <dependencies></dependencies> <account>bitrock</account> <password>mySecRetPassword!!</password> </createWindowsService>

    This is documented in more details in Windows Services section of InstallBuilder User Guide.

  • Avatar
    wojciechka

    You can persist variables so they are accessible in uninstaller by using <setInstallerVariable> action with <persist> enabled - for example you can make the variables available in uninstaller by doing:

    <setInstallerVariable> <name>newServiceName</name> <persist>1</persist> <value>${newServiceName}</value> </setInstallerVariable> <setInstallerVariable> <name>newDisplayName</name> <persist>1</persist> <value>${newDisplayName}</value> </setInstallerVariable>

Please sign in to leave a comment.