ozgekaya
Posts: 20
Joined: Thu May 08, 2014 7:52 am

CheckIfUserExists - changing one custom action affects all

Hello,

I have upgraded to v16.3 and trying to recreate my old packages. My package is using CheckIfUserExists custom action to check for both groups and users.
I have seen that all my custom actions are now set to check "Search in Users" . When I edit only one custom action and set it to "Search in groups" all my other custom actions also change to this setting.

I have replicated the same issue by creating a new project too. Furthermore, changing Name: setting also affects all other custom actions too. Please see the attachment.
checkIfUserExists.aip
(13.98 KiB) Downloaded 336 times
Is there a workaround for this?

Regards,
Özge
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: CheckIfUserExists - changing one custom action affects all

Hello Özge,

This is not a bug. It is the way this custom action is designed. It uses some predefined properties, it does not generate new ones for each custom action instance.

For instance, when the "Search in groups" option is selected, the "AI_USER_IS_GROUP" property is set to "1" in the "Table Editor".

We are looking to improve this "design". Whenever this will be done, I will update this thread.

However, there is a workaround, you can simply use an installer property as the parameter of your actions. For instance you can configure the following custom actions in "Custom Actions" page:

- first thing that needs to be done is to change your "CheckIfUserExists_user" and "CheckIfUserExists_group" custom actions from "Explicit values" to "Property based".

- by doing so, we will then need to use the USER_NAME and DOMAIN_NAME properties. Instead of you giving specific values, we can use the "Set property" custom action in order to set the USER_NAME property to the user you are looking for.

Basically, here are the steps:

1. set the USER_NAME property to the user that you are looking for (e.g. Catalin)

2. CheckIfUserExists_user custom action executes

3. set the AI_USER_IS_GROUP property to 1 (this is the same as changing to the "Search in groups" option from "CheckIfUserExists" custom action)

4. set the USER_NAME property again for the group that you are looking for (e.g. Guests)

OBS: both users and groups can be seen by opening a run window (WIN+R) and typing: lusrmgr.msc (so you can test the above on your machine)

5. CheckIfUserExists_group custom action takes place

In addition to the above, please find attached your sent .AIP file, but modified according to the above steps:
checkIfUserExists.aip
(15.48 KiB) Downloaded 324 times
Also, I have added two more custom actions (message boxes) which simply show the value of the AI_USER_EXISTS property (which returns "Yes" if the user exists and "No" otherwise). Have done this mostly to check if the second custom action is looking in the "Groups", not in the "Users".

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”