Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Install Windows Service with dynamic name (name taken from dialog box


4 replies to this topic

josefk

josefk
  • Full Members
  • 2 posts

Posted 06 May 2017 - 13:34

Hi All,

I am trying to create/install Windows Service with dynamic name (name taken from dialog box during installation).

I am using same technique as updating XML file, but its not working
...for instance.....
in the dialog box during installation, I take few properties to update into XML file. For that...I pass value/property as....
[value1], [value2],...so on.

So name/value taken from the dialog box, I need to set that as "Display Name" and the "Service Name" of the service. Such as below....
Display Name: [TestServiceName]

Can you please suggest how that can be achieved.
Your help is really appreciated.

Thank you in advance!



deramor

deramor
  • Full Members
  • 187 posts

Posted 10 May 2017 - 16:30

I think the best way to do this would be through a custom action.  Using the text input as the input for the service create command in the command line.

 

If you are setting settings that go beyond just starting a service, you may need to do some extra research for setting dependencies and recovery conditions.

 

You also need to have an uninstall custom action.  Keep in mind the value the user gave you at install time is long since gone.  You might want to save it in a registry key for retrieval during uninstall.

 

There are built in functions in InstallScript for adding and removing services.  Not sure how many of the extra settings they can set however.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 May 2017 - 19:13

You need to use a proeprty name which has no lower case letters: TESTSERVICENAME

Only such properties keep their value when the installation switches from UI to execute sequence.



josefk

josefk
  • Full Members
  • 2 posts

Posted 15 May 2017 - 08:46

Hi Guys

 

Really Thanks for your replies.

 

@deramor: I do create/use in built command lines, for such as starting automatic services, running the services, stop and delete on uninstall and so on. However, I couldn't find any command line for taking the name dynamically. 

 

@Stefan: Currently thats how I was trying to do, but not working as expected. In the post I have written in Caps and Small cases... but in Install shield name is as you have suggested. TESTSERVICENAME.

 

Best regards

Josef



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 May 2017 - 13:53

Is TESTSERVICENAME also listed in the property named SecureCustomProperties?

If it still doesn't work, generate a verbose log. It will show anytime the value of the property changes.