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

Allow any user to start and stop windows services


1 reply to this topic

TobiasEriksson

TobiasEriksson
  • Members
  • 16 posts

Posted 02 February 2004 - 14:19

I've just installed a service (MySQL) and now I would like to allow any user on the machine to start and stop the service. Is that possible somehow?

/Tobias

TobiasEriksson

TobiasEriksson
  • Members
  • 16 posts

Posted 03 February 2004 - 15:36

Finally I have found a solution that seems to work fine. It is quite easy and the only thing needed is a CustomAction and the EXE included in the Binary-table.
The EXE (servicesaccess.exe) can be found together with the source in the ZIP-file that I have attached.

Binary-table
Name: servicesaccess
Data: <browse>

CustomAction-table
Action: AllowAnyoneToStartStopMySQLService
Type: 2
Source: servicesaccess
Target: [SID_EVERYONE] mysqld-nt.exe

InstallExecuteSequence-table
Action: AllowAnyoneToStartStopMySQLService
Condition:
Sequence: 6700

The Target is the command line arguments to the command, and is the <user name> <service name>. The SID_EVERYONE is simply the EVERYONE user although I'm using a mergemodule that makes it possible to find the name for EVERYONE on any machine regardless of the language. The mysqld-nt.exe is the name of the service that we would like to change the access permissions for.

The servicesaccess.exe will change the access permissions so that it is possible to START, STOP, DELETE and READ_CONTROL for the user provided.

The source for the exe was found in an MSDN article, which I have modified slightly. I guess I could have made it a DLL instead and perhaps I then would have avoided the DOS-console that pops up during the installation.

Joy
Tobias

Attached Files