Assign nt rights to user: where to place the custom action? - Advanced Installer Community
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Assign nt rights to user: where to place the custom action?

Hi all,

I have the issue to assign a bunch of NT rights to a user that has just been created.
I know I can write a custom action script using the command ntrights.exe, but I need to know when the user is created in the flow of the setup execution.
Can anybody please help me?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Assign nt rights to user: where to place the custom action?

Hello,

If a new account is added in the "Users and Groups" page, an action that "installs" the account will be added between the "AllocateRegistrySpace" and "ProcessComponents" standard actions, during the "Preparing" action group in the "Install Execution Stage". Therefore, you should add your custom action after the "ProcessComponents" standard action.

In order to display the "ProcessComponents" standard action in the "Custom Actions" page, please right click on "Preparing" action group --> "Show Standard Action" --> "Preparing" --> click on the "ProcessComponents" action
ProcessComponents.png
ProcessComponents.png (253.82 KiB) Viewed 4936 times
Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: Assign nt rights to user: where to place the custom action?

Thank you very much!
Kind regards,
Silvio
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Assign nt rights to user: where to place the custom action?

You are always welcome, SIlvio.

Glad to help.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: Assign nt rights to user: where to place the custom action?

One more question: I need the files being deployed since the command I use to assign nt rights is actually among the installed ones.
When the actual deploy of the files under APPDIR folder takes place?
I tried to place this script run just before the InstallServices (please see the attached picture) but with a message box placed there I could break the execution to see whether the grant-rights application path was existing and it was not (in fact it reacts with a path not found error and the setup terminates).

More in general, is there a place where I can read about those events of the sequences of the installation? I have seen from those right click menu you showed me they are quite a lot!
Attachments
GrantRights_script_action.PNG
GrantRights_script_action.PNG (10.73 KiB) Viewed 4907 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Assign nt rights to user: where to place the custom action?

Hello,

The files are copied on the target machine during the "Add Resources" action group, on the deferred stage.

with a message box placed there I could break the execution to see whether the grant-rights application path was existing and it was not (in fact it reacts with a path not found error and the setup terminates).
Most probably, this happens due to the fact that your custom action is scheduled to run during the "Immediate" stage, whereas the files are copied during the deferred stage. Could you please go to "Custom Actions" page --> select your custom action --> under "Execution Time" please select the "When the system is being modified (deferred)" radio button? This way, the custom action should be executed after the files are copied on the machine, therefore everything should work as expected.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: Assign nt rights to user: where to place the custom action?

Thank you!
At this time, properties are still available (and valued as expected)?
Because just after modifying the time when to execute the script, it seems I can't get APPDIR or other property value.
Thanks again,
Silvio
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: Assign nt rights to user: where to place the custom action?

I guess I missed this info on the help. Sorry ;)
I've read this:
https://www.advancedinstaller.com/user- ... ction.html
Sorry to ask something was already written in the doc!

Kind regards,
Silvio
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Assign nt rights to user: where to place the custom action?

You are always welcome, Silvio.

I'm glad you got this working.

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

Return to “Common Problems”