1

I have a Windows service application whose installer I am building using install shield. How to set the DACL of the service while installing? I know I can do a "sc sdset" after installing. But I want to set the elevated permissions as part of the install process. Is there a way to do that?

Arnoj
  • 79
  • 8

2 Answers2

0

I assume you have properly created installation your your service. The following resource may be helpful to confirm that: Using InstallShield to Create an Installation that Installs Windows Services as well as InstallShield help library: Installing, Controlling, and Configuring Windows Services.

I am not sure if DACL settings can be set by using IDE, you probably able to quickly explore this option, but I assume it is not there and you want to do that by hand. In this case the simplest solution I can see is to create Custom Action (CA) and set "In-Script Execution" to "Deferred Execution in System Context". By doing this you set elevated execution of this CA. Schedule this CA somewhere in Execution Sequence (Not in UI sequence), probably right after "InstallServices". Now you have a few options what this CA should do. For example you may just use command line "sc" to set desirable permissions. You may also write VBScript CA to do the same. You may write installation helper dll with would do registration for you. All in your hands. More on those option over there.

Community
  • 1
  • 1
Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
  • Thank you very much for your answer. Still investigating. Will post an answer if it gets solved. – Arnoj Apr 21 '17 at 09:27
0

Just after the installation run this command as part of post installation procedure: SUBINACL /SERVICE /GRANT=S-1-5-32-545=TO

This gives the windows service the admin privileges.

Arnoj
  • 79
  • 8