PDA

View Full Version : Install NT Service with specific accout



NewsArchive
09-01-1999, 12:00 AM
Thanks David, it works.

David Thornley <NoReplyPlease@installshield.com> wrote in message
news:37cd57d4.0@news.installshield.com...
> Do the dependencies exist on the system?
>
> If so, try trailing the list of debendencied with "[~][~]" minus the
double
> quotes.
>
> --
> David Thornley
> Lead Developer Support Engineer
> InstallShield Software Corporation
> http://www.installshield.com
>
>
>
> Eric Liu wrote in message <37cd33cb.0@news.installshield.com>...
> >I found if I leave Dependencies blank, and enter User Name and Password,
it
> >works well.
> >If I enter something at Dependencies, I got error 1920:
> > "Service '[2]' ([3]) failed to start. Verify that you have
> >sufficient privileges to start system services."
> >If I click "Cancel", Setup roll back.
> >I check the registry, found the DependOnService messed up, it looks like
> >
> >"
> >RpcSs
> >ng$
> >??
> >
> >
> >User Name
> >??
> >
> >Password
> >"
> >
> >RpcSs is the dependency I need.
> >
> >If I enter Dependencies and leave User Name and Password blank, it works
> >well.
> >
> >
> >Eric
> >
> >----- Original Message -----
> >Hello Eric.
> >
> >Does the user account exist during installation ?
> >I have the same problem (roll back ) when the user account not exists in
> >domain ( Comment: I tried to install the COM NT service under new user
> >(domain) account; I thought the ISWI create the account automatically ).
> >
> >Igor Z.
> >
> >----- Original Message -----
> >From: Eric Liu <eliu@wquinn.com>
> >Newsgroups: installshield.iswi.customactions
> >Sent: Tuesday, August 31, 1999 11:47 PM
> >Subject: Install NT Services
> >
> >
> >> In the Install NT Services, there are two properities:
> >> User Name and Password, when I leave them blank, it works well. When I
> >enter
> >> the account and password, the set up roll back. Does anyone encounter
> this
> >> sitiuation?
> >> Thanks
> >>
> >>
> >> Eric
> >>
> >>
> >
> >
>
>

NewsArchive
01-22-2001, 01:00 AM
It's not only that the LocalService and Appid entries aren't in HKCR, they
don't get found anyway if the service is running under the local system
account, because local system account users get redirected to
HKLM\Software\Classes for those registry entries.

"Joerg Pfuendl" <j_pfuendl@hotmail.com> wrote in message
news:3a680b74$1@12.41.20.38...
> Derek,
> if this is an ATL based service you need to remove a couple of lines in
the
> t_WinMain function starting with:
> // Are we Service or Local Server
> up to
> _Module.Start(); (Well, leave this line in the code, of course :-) )
>
> Instead you should include a forth command line option 'Debug' to
determine
> if you are running as a local server or a service and set
_Module.m_bService
> = FALSE.
>
> It seems that ISWI calls the executable without the 'Service' flag
therefore
> it tries to acces this RegKey which seems not to exist in the first
place...
> They claim to have that fixed in the 2.02 release but I don't know if this
> has been released yet.
> I hope that helps
>
> Joerg
>
>
> "Derek Lim" <derek_lim@infrasys.com.hk> wrote in message
> news:3a66ba36@12.41.20.38...
> > I met problem when install NT Service by InstallShield. After the
service
> is
> > installed and can be viewed in the Service Applet, it cannot start.
Every
> > time the service start, Error Message "Error 1053: The service did not
> > respond to the start or control request in a timely fashion"! The
service
> > logs on as LocalSystem. How can I solve it?
> >
> > Derek
> >
> >
>
>

evgenyp
03-07-2002, 03:53 AM
Hi

I want to install NT service with specific domain/user and password. I've created Dialog that requests from the user this information, performs verifications and ... now I need to update username and password in ServiceInstall table. How I can do it? MsiViewModify with MSIMODIFY_UPDATE flag doesn't work.

Thanks
Evgeny

alastair.camero
03-09-2002, 02:02 PM
I'm creating NT services but don't require them to be set to run under a non-default context (i.e. other than localsystem) so I'm not doing exactly what you need.

However, I seem to remember that you can specify the username/password information in the InstallShield IDE using Property values (i.e. [UserName], [Password]), and these values will be expanded when the serviceinstall entries are written.

So, if you are getting values from a dialog, can't you setup two PUBLIC properties called NTServiceName and NTPassword and use MSISetProperty from your dialog exit code?

Have you tried this?

Alastair

evgenyp
03-10-2002, 04:59 AM
Alastair,
Thank you, it works fine.

Evgeny

nobilzk
07-29-2003, 07:21 AM
I Have used a Global property Like [SERVICENAME] and [PASSWORD] in the Advanced setting of NTService. I am getting The user Name and Password from a Dialog Box In installshield developer 7.0. For the username i am appending .\USERNAME to the property(.\). but when i run installation, when the service is installed the installation rolls back.

But if i Hardcode the userName and password directly(as
.\Username and Password values) its working properly.I am using VBSCRIPT in CAction.

graven
07-29-2003, 09:49 AM
the proposed solution is correct:

in the component's advanced settings "install NT service" reference your properties in square brackets:


user: [MY_DOMAINUSER]
pwd: [MY_SVC_PWD]


to convert the username to a "domainuser" you should call something like the following installscript function (any comments appreciated):


///////////////////////////////////////////////////////////////////////////////
// Function: GetDomainOfUser
// Purpose: Function to retrieve the complete user name incl. domain (where available)
// IN: Handle to the MSI package
// EFFECT: sets public property "MY_DOMAINUSER"
///////////////////////////////////////////////////////////////////////////////
function NUMBER GetDomainOfUser(hMSI)
//# local variables:
STRING svTmp; //
STRING svDomain; // USERDOMAIN e.g. "microsoft"
STRING svUser; // USER e.g. "billg"
STRING svDomainUser;// e.g. "microsoft\billg"
NUMBER nResult;
NUMBER nvSize;
begin
try
nResult = GetEnvVar("USERDOMAIN", svTmp);
if (nResult = 0) then
svDomain = svTmp;
else
svDomain = "";
endif;

nvSize = 256;
//# Retrieve the user name from the MSI database
//# use an account name in the form "DomainName\UserName". If the account
//# belongs to the built-in domain it is permitted to specify ".\UserName".
/*
permitted variants:
- machine\user
- domain\user
- .\user
*/
nResult = MsiGetProperty(hMSI, "LogonUser", svTmp, nvSize);
if (nResult = 0) then
svUser = svTmp;
else
svUser = ".\LogonUser";
endif;

if (svDomain = "") then
svDomainUser = svUser;
else
svDomainUser = svDomain + "\\" + svUser;
endif;

MsiSetProperty(hMSI, "MY_DOMAINUSER", svDomainUser);
return 0;
catch
MessageBox("Exception: GetDomainOfUser(hMSI)", SEVERE);
return 0;
endcatch;
end;


maybe your approach rolled back 'cause you didn't use double-backslash ("\\")?

cheers, graven

nobilzk
07-30-2003, 03:44 AM
Thanks for the reply

But where have i to use the double slash(\\). the following is the code in VBScript custom action

Dim userName
Dim Password
userName = Session.Property("SERVICENAME")
Password = Session.Property("SERVICEPASSWORD")
MsgBox userName
MsgBox Password
Session.Property("SERVICETEMPNAME")= ".\" & userName
Session.Property("SERVICETEMPPASSWORD")= Password
MsgBox Session.Property("SERVICETEMPNAME")
MsgBox Session.Property("SERVICETEMPPASSWORD")


The MessageBox displays the correct values.

I have given the UserName and Password fields in Advanced setting as [SERVICETEMPNAME] and [SERVICETEMPPASSWORD] respectively.

still it rolls back


I didnt try with the domain user

graven
07-30-2003, 04:45 AM
why does it roll back?

the one and only method to find out what's wrong with your setup is to use "verbose logging"! (actually, this should be enabled by default for every new project!!)

check the following thread (covering a different topic) on how to enable verbose logging:
http://community.installshield.com/showthread.php?s=&threadid=99677&highlight=verbose+logging+graven

graven

Sean Perkin
09-17-2003, 02:21 PM
Hi Folks,

I'm trying the same thing.

If I use any user (from the local Administrator Group) other than .\LocalSystem I get the following message.

Service,ImagePath=C:\Program Files\Commerce\Spoke\PublisherService.exe,Se
rviceType=272,StartType=2,ErrorControl=1,,,,StartName=.\test.user,Password=**********,)
Error 1923.Service Spoke Publisher Service (PublisherService) could not be installed. Verify that you have sufficient privileges to install system services.
MSI (c) (80:98): Invoke wait timed out
MSI (s) (94:78): Invoke wait timed out
MSI (c) (80:98): Invoke wait timed out
MSI (s) (94:78): Invoke wait timed out
MSI (s) (94:78): Product: eSpoke 2003 -- Error 1923.Service Spoke Publisher Service (PublisherService) could not be installed. Verify that you have sufficient privileges to install system services.

Is there a work-around?

I've tried all sorts of combinations.

Regards,

Sean

Sean Perkin
09-19-2003, 03:03 PM
It turned out that on of my settings in "install nt Service" was incorrect.

Be careful to check your settings.

Jeff Barth
09-24-2003, 07:59 PM
Originally posted by graven

in the component's advanced settings "install NT service" reference your properties in square brackets:


user: [MY_DOMAINUSER]
pwd: [MY_SVC_PWD]




I notice that properties are dumped at the end of the install log. If I set a property to a password, won't the password be displayed in plain text in the install log?

Is there a way to mark a property as being hidden, or containing a password so that it shouldn't be printed literally in the install log?

Perhaps one solution is to create a CA that clears the password property after it is used?

Thanks,
--jb.

Rameshbabu_b
09-25-2003, 11:37 PM
USERNAME must be in one of the following format:

1) computername/username (or) ./username
2) domainname/username

Sean,

Since you got the "Error 1923. ......Verify that you have sufficient privileges to install system services."; for me it looks like the user account you used to startup the service did not have enough rights to start the service. Make sure that this user account has been granted "Logon as service" policy setting and should NOT be in the "deny logon as service' policy setting.

andyansryan
06-14-2004, 06:10 PM
alastair.camero or evgenyp


I specified [username] and [password] in the install shield ide where the service install entries as written. Then I used


err = MsiSetProperty(ISMSI_HANDLE, "[UserName]", ".\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "[Password]", "qazwsxedc");


But it does not set the values to the Nt Service logon. Can you please help. than you

Rameshbabu_b
06-14-2004, 11:04 PM
MsiSetProperty function must be like this:

err = MsiSetProperty(ISMSI_HANDLE, "USERNAME", ".\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "PASSWORD", "qazwsxedc");

Note that square braces should not be used here. So, I removed them. Also, I changed the property to all uppercase letters as it should be PUBLIC property. Hope this will help.
Another thing is that you use backslash in username value. You may have to put one more backslash adjacent to that to avaoid InstallShield compiler to take that as a ESCAPE sequence.

FYI: You can get the local computer name by using InstallShield's builtin property "ComputerName" (please refer HELP document for exact spelling for this property) and then concatenate the computer name and the user name if you wish.

Hope this helps.

andyansryan
06-15-2004, 01:13 PM
Rameshbabu_b,


thanks for the help, I tried using the following cobinations put I get Error 1923 Verify that you have sufficient privileges to install system services. The account Aansryan is part of the administrators group.

err = MsiSetProperty(ISMSI_HANDLE, "USERNAME", ".\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "PASSWORD", "qazwsxedc");


and


err = MsiSetProperty(ISMSI_HANDLE, "USERNAME", ".\\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "PASSWORD", "qazwsxedc");


and


err = MsiSetProperty(ISMSI_HANDLE, "USERNAME", "computername\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "PASSWORD", "qazwsxedc");



and


err = MsiSetProperty(ISMSI_HANDLE, "USERNAME", "computername\\Aansryan");
err = MsiSetProperty(ISMSI_HANDLE, "PASSWORD", "qazwsxedc");


they all prompt error 1923 during installation. Please advise. Thank you.

Rameshbabu_b
06-16-2004, 11:20 PM
Make sure that the administrators group has been added to "Logon As Service" security policy setting and also make sure that it is NOT in "Deny logon as Service" policy.

To verify that, goto Control Panel->Administrative tools->Local Security Policy->User security assignment(or something like that!).
If you make any change here, make sure that you reboot the computer.

andyansryan
06-18-2004, 12:39 PM
Yes,

Log on as service has the users which I want to create included. Any other ideas are welcome.

thank you in advanced.

Andy

Rameshbabu_b
06-19-2004, 01:08 AM
The below link may be useful. Give a try.

http://support.installshield.com/kb/view.asp?articleid=Q107628

If nothing works, I would say try the same setup or msi in a different machine, preferably a cleanly built Vitual Machine or any other non-developer's machines.

Did you try with a Domain user instead of local user account? (just to see at least that works).

Did you try with the default local "administrator" user account itself?

hmm...that's all I can think of for now. All the best!