buzz71
Posts: 25
Joined: Tue Nov 02, 2010 11:03 am

Permission allocation on non-English Windows versions

Mon Oct 10, 2011 3:22 pm

Hi

I have an installation which allocates specific permissions to a folder on installation. These permissions are set up as follows via the "Permissions" tab on the "Edit Folder" dialog:

NetworkService
Administrators
Users
Power Users
SYSTEM

This works fine on installation to any English language version of the O/S this has been tried on (Win XP/2003/7/2008).

However on a French language version of XP the following error occurred:

Code: Select all

Error 1609. An error occurred while applying security settings. Users is not a valid user or group. This could be a problem with the package, or a problem connecting to a domain controller on the network. Check your network connection and click Retry, or Cancel to end the install.       Unable to locate the user's SID, system error 1332
This is because "Users" group does not exist on the French language XP (equivalent is "Utilsateurs"). Also, Power Users does not exist in this version of the O/S.

As a workaround I got the customer to create "Users" & "Power Users" groups on the target machine to get the installation to work.

However, I need to be able to avoid this in future, and there are potentially many different language versions of O/S that the software will be installed on. How can I "map" the Users permission to the language specific User group on the target O/S?

Thanks for your help in advance.

Buzz

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

Re: Permission allocation on non-English Windows versions

Mon Oct 10, 2011 3:26 pm

Hi Buzz,

Here's a link to a similar thread that debates this issue:
http://www.advancedinstaller.com/forums ... 568#p46909

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

buzz71
Posts: 25
Joined: Tue Nov 02, 2010 11:03 am

Re: Permission allocation on non-English Windows versions

Thu Oct 20, 2011 10:08 am

Hi

I have created a .NET DLL that includes functions which return the values of localised "Users" and "Power Users" depending on the language of the O/S.

But I am unsure how to include this in the Advanced Installer project through a custom action. Do you have an example to share of how to use a .NET dll in a custom action please?

Thanks in advance.

Buzz

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

Re: Permission allocation on non-English Windows versions

Thu Oct 20, 2011 11:21 am

Hi Buzz,

Here is an article you can follow to create a fully fledged .NET custom action.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

buzz71
Posts: 25
Joined: Tue Nov 02, 2010 11:03 am

Re: Permission allocation on non-English Windows versions

Thu Oct 20, 2011 2:50 pm

Hi

I have created the WiX project as specified and have a function that looks like this in the c# dll that returns a string if called through a test harness:

Code: Select all

        /// <summary>
        /// Get the POWERUSER alias for the language O/S
        /// </summary>
        /// <returns></returns>
        [CustomAction]
        public static string Get_USER_Alias()
        {
            return Globalisation.Get_USER_Alias();
        }
But fails on install. I get from the log file:

Code: Select all

Action start 14:36:58: WiXUsersCustomAction.CA.dll.
MSI (s) (84:58) [14:36:58:389]: Invoking remote custom action. DLL: C:\Program Files\X\UserTest\WiXUsersCustomAction.CA.dll, Entrypoint: Get_USER_Alias
Action ended 14:36:58: WiXUsersCustomAction.CA.dll. Return value 3.
Action ended 14:36:58: INSTALL. Return value 3.
I call the rouine with the following custom action definition from InstallExecuteSequence -> CostFinalize:
Function Name: Get_USER_Alias
Action data: [DUMMY]

[DUMMY] was set up on the "Install Parameters" page.

Can you see anything obviously wrong with the way I call the function? Is putting the [DUMMY] parameter in the Action Data section the way to get the return of the call to the dll into the parameter?

Kind Regards,

Buzz

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

Re: Permission allocation on non-English Windows versions

Fri Oct 21, 2011 8:02 am

Hi Buzz,

The custom action should return one of the following values to control the installation process:
  • 0 action not executed
  • 1 success
  • 2 user canceled
  • 3 fatal error
  • 4 suspended, waiting for a reboot
Depending on these values, the installation will continue or rollback.

If you need to get or set installer public properties from within your fully fledged .NET custom action here is how:

Code: Select all

public static ActionResult CustomAction1(Session session)
{
// sending message to installation log
session.Log("Begin CustomAction1");

// getting a property
YourVariable = session["YOUR_PROPERTY"];

// setting a property
session["YOUR_PROPERTY"] = "YOUR_VALUE";

return ActionResult.Success;
}
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

buzz71
Posts: 25
Joined: Tue Nov 02, 2010 11:03 am

Re: Permission allocation on non-English Windows versions

Fri Oct 21, 2011 12:08 pm

Hi Mihai

Thanks for the information.

I have made my installation very simple now - installing a single file and trying to update a "DUMMY" variable with a string.

The code in the Custom Action Dll now has a single function:

Code: Select all

        [CustomAction]
        public static ActionResult CustomAction1(Session session)
        {
            // sending message to installation log
            session.Log("Begin CustomAction1");

            // getting a property
            string GetDummy = session["DUMMY"];

            // setting a property
            session["DUMMY"] = "Changed in code...";

            session.Log("Completed CustomAction1");

            return ActionResult.Success;
        }
But when I execute the installation the following is logged:

Code: Select all

MSI (s) (9C:B4) [11:58:26:417]: Doing action: WiXUsersCustomAction.CA.dll
Action 11:58:26: WiXUsersCustomAction.CA.dll. 
Action start 11:58:26: WiXUsersCustomAction.CA.dll.
MSI (s) (9C:EC) [11:58:26:427]: Invoking remote custom action. DLL: C:\Program Files\X\Test\WiXUsersCustomAction.CA.dll, Entrypoint: CustomAction1
Action ended 11:58:26: WiXUsersCustomAction.CA.dll. Return value 3.
Action ended 11:58:26: INSTALL. Return value 3.
Could you please advise on what I may be doing wrong?

Thanks in advance

Buzz

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

Re: Permission allocation on non-English Windows versions

Mon Oct 24, 2011 8:09 am

Hi Buzz,

I am not sure why you are getting this behavior. Can you please send us the .AIP (project) and the verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Permission allocation on non-English Windows versions

Mon Oct 24, 2011 3:51 pm

Hi Buzz,

By definition, an "Installed Custom Action" behaves as an attached custom action, but it must be scheduled after the files have been deployed on the target computer.

In your particular case, you can try to move the custom action after the Install standard action.
Another approach is to use an "Attached Custom Action" instead. In this case you can schedule it under after any standard action.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

clint
Posts: 135
Joined: Fri Jun 19, 2009 9:46 am
Location: Germany

Re: Permission allocation on non-English Windows versions

Tue Mar 14, 2017 11:20 am

Last week I had a customer with a German system, who towards the end of the installation also received this error (Error 1609 and SID system error 1332) , where permissions folders were trying to be set set for users and groups "Administrator" and "Everyone".

I noticed that in the MSI LockPermissions table, the domain column was empty.

So in the advanced installer Resources "Files and Folders" for the folder in question, under Properties-Permissions I added the property [%USERDOMAIN] into the field "Domain".

After that the installation worked.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Permission allocation on non-English Windows versions

Tue Mar 14, 2017 2:08 pm

Hi,

Thank you for sharing the solution, I'm sure it will help other users in the future.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”