This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Service failing to start during install. Need to set "Log on as service" policy
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 30, 2009
11:50 AM
Service failing to start during install. Need to set "Log on as service" policy
I am using Installshield (Basic MSI) to install and start a service during the installation process of my product. I am using the service control settings to start the service. During the install my service fails to start and I get this error in the event log.
Is there a way in Installshield to automatically add this user to this policy?
This service account does not have the necessary user right "Log on as a service."
User Action
Assign "Log on as a service" to the service account on this computer. You can use Local Security Settings (Secpol.msc) to do this. If this computer is a node in a cluster, check that this user right is assigned to the Cluster service account on all nodes in the cluster.
Is there a way in Installshield to automatically add this user to this policy?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 30, 2009
12:57 PM
This may not be the most elegant solution, but it's what I do.
step 1: place NTrights.exe in your support files directory (found in resource kit).
note: this is called by another installscript method of mine that has already figured out where supportDir is, but if you need to get it yourself you can use MsiGetProperty or any other method you prefer.
step 1: place NTrights.exe in your support files directory (found in resource kit).
note: this is called by another installscript method of mine that has already figured out where supportDir is, but if you need to get it yourself you can use MsiGetProperty or any other method you prefer.
////////////////////////////////////////////////////////////////////////////
// Sets a user's "Start as service" right.
////////////////////////////////////////////////////////////////////////////
function UTIL_SetLogonAsServiceRight(hMSI, userName, supportDir)
string path, cmdLine;
number returnValue, buffer;
begin
UTIL_WriteToLogFile(hMSI, "Entering SetLogonAsServiceRight for user: " + userName);
// NTRIGHTS.EXE is in the Support Files/Language Independent section of the MSI database.
// The SeServiceLogonRight allows the specified User Id to be used as security credentials for a service.
path = supportDir ^ "NTRIGHTS.EXE";
cmdLine = "-u " + userName +" +r SeServiceLogonRight";
UTIL_WriteToLogFile(hMSI, "Executing:" + path + " " + cmdLine);
returnValue = LaunchAppAndWait(path, cmdLine, WAIT | LAAW_OPTION_HIDDEN);
if (returnValue != ISERR_SUCCESS) then
return -1;
else
return 0;
endif;
UTIL_WriteToLogFile(hMSI, "Exiting SetLogonAsServiceRight");
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 30, 2009
02:00 PM
This was the only way I could think of doing it as well. I guess I will just go ahead and follow this.