Localized Network Service property name - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

yoramkr
Posts: 6
Joined: Mon Feb 07, 2011 3:00 pm

Localized Network Service property name

Hi

My installer installs a IIS web server.
Part of the installation is to set the permissions of the folder holding the server files to NT AUTHORITY\NETWORK SERVICE account.
All works well until I try to install on an OS that is not in English.
For example, when I try to install on Danish win7 OS I get the following error in the install when it gets to 'Creating folders' part:
"An error occurred while applying security settings. NT AUTHORITY\NETWORK SERVICE is not a valid user or group..."

After researching the issue on-line I've found out that the property name "NETWORK SERVICE" is localized and may be different depending on the OS language (in Danish it's " NT AUTHORITY\Netværkstjeneste").
Please see MSDN reference (look at the bottom of the page under 'Localized Service Names'): http://msdn.microsoft.com/en-us/library/ms143504.aspx

My questions are:
Can I get this localized property at run time?
Is there a windows property that holds this localized name?
If not, what can you suggest me to do so I can use my installer on multiple languages without "hard coding" the localized name for each one?

Thanks,
Yoram
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Localized Network Service property name

Hello Yoram and welcome to the Advanced Installer Forums,

We have a how to article in our user guide that can help you localize a public property. Please follow this link and let us know if you have any questions.

Have you tried to set the folder permissions by using the "Permissions Dialog" from the folder's permissions tab, more specifically with the "Administrators" username?

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yoramkr
Posts: 6
Joined: Mon Feb 07, 2011 3:00 pm

Re: Localized Network Service property name

Hi Mihai and thanks for your reply.

Unfortunately I don't think you truly understood my question.
The link you gave me specify how to localize your own property.
What I'm looking for is a property that is set by the OS, like: [username], [system_path].
These kind of property are set depending of the environment the installer is running on.

An important part of setting an IIS web server is to give the web server folder the specific permission under Domain 'NT AUTHORITY' and username 'NETWORK SERVICE'.
This Domain and Username are built in to every windows OS.
As I found out, this username is localized by the OS and of course I have no way of knowing what is the localized username for every possible language my clients will use and I don't want to restrict them to use only English.

My question was: Is there an OS controlled property that holds this localized 'NETWORK SERVICE' username and how can I access it?

Thanks again,
Yoram
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Localized Network Service property name

Hello Yoram,

The NetworkService property should be localized only in the UI. Internally it should remain in English. Also, please make sure you are using "NetworkService" and not "NETWORK SERVICE". Please follow this MSDN link for more details.
If this is not he case, can you please give us more details on how are you using the property?

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yoramkr
Posts: 6
Joined: Mon Feb 07, 2011 3:00 pm

Re: Localized Network Service property name

Hi

I tried what you suggested but there is no NetworkService property in Advanced Installer. Maybe I didn't understand you.
I tried, NetworkService , [NetworkService] and [NETWORK SERVICE], the installer can't find any of them.
I looked at the link you gave me but this is true when you use the function listed in the link in C++ applications.

What I'm doing is:
In 'Files and Folder', on the property of one of my installed folder I set the permission.
for XP:
Domain: ASPNET
Username: [%USERDOMAIN]
For vista and win7:
Domain: NT AUTHORITY
Username: NETWORK SERVICE

These settings works perfectly under English OS (XP, Vista and win7) and aon localized OS's it tells me that it can't find this username.

Any suggestions??

Thanks
Yoram
yoramkr
Posts: 6
Joined: Mon Feb 07, 2011 3:00 pm

Re: Localized Network Service property name

Hi

I think I've found a solution and I would like your help in testing it.
I've found a link that describes how to get the localized Network Service name with a vb script:

' VBScript source code
Set objWMI = GetObject ("winmgmts:root\cimv2")
Set objSid = objWMI.Get ("Win32_SID.SID='S-1-5-20'")
WScript.Echo objSid.ReferencedDomainName & "\" & objSid.AccountName

This script output to the console the correct localized name. I've tested it in English OS and Danish OS.
Now I need to change the script so it will update a User Property in the installer that I could pass to the permission dialog.

The problem is that I don't really know how to use VB script in Advanced Installer to set the value of a User property.

Please advise,
Thanks,
Yoram
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Localized Network Service property name

Hi Yoram,

Actually, for Vista and above the "Username:" field should be set to:

Code: Select all

NetworkService
This is not a property, just plain text.

In VBScript, installer public properties can be accessed like this:

Code: Select all

' read
value = Session.Property("PROPERTY_NAME")

' write
Session.Property("PROPERTY_NAME") = value
Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yoramkr
Posts: 6
Joined: Mon Feb 07, 2011 3:00 pm

Re: Localized Network Service property name

Hi Mihai

Just wanted to let you now the the vb script did the work and I'm now setting 2 public properties with the script and I get the localized Domain and Username.
I use these properties to set the permissions to my web server folder.
The installer works great on English and other localized OS's.

I'm sorry but you are wrong about the username, it actually is 'NETWORK SERVICE'. I recheck it and it only works like this.

Thanks for your help,
Yoram

Return to “Common Problems”