mgorga
Posts: 45
Joined: Fri Jun 03, 2011 1:00 pm

Create user and shared folder

Dears,
I want to create a user and then use it to share a folder. The problem is when I give permissions to the shared folder. The installer is trying to give permissions before creating the user so the install fails. I tried to change the execution order of the actions in the panel "Custom actions" without success. If I don't change permissions to the folder it is shared correctly but then the problem is that this newly created user has no permissions to do anything in the folder.

The sequence that I think it will work:
1. Create a new user.
2. Create a folder.
3. Share the folder.
4. Change permissions to folder => it seem that this action is made before creating the new user

How can I do it?

Best regards,
Mario
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create user and shared folder

Hello Mario,

As a workaround, to achieve what you want you can create an additional setup project which will only create the new user, and add the additional setup as a feature-based prerequisite to your main project.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mgorga
Posts: 45
Joined: Fri Jun 03, 2011 1:00 pm

Re: Create user and shared folder

Thank you,
I will evaluate if the workaround meets our requirements. We need to evaluate the impact of installing a pre-requisite package because this is not our ideal scenario. We usually try to avoid dependences between the different installers that we create, even in this simple case.

Best regards,
Mario
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create user and shared folder

Hello Mario,

As another solution, instead of a separate setup package, you can develop your own custom action which will create the new user. The custom action can be added with sequence before "Install Execution Stage -> Add Resources" action group.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mgorga
Posts: 45
Joined: Fri Jun 03, 2011 1:00 pm

Re: Create user and shared folder

Dear Daniel,
I've created a .bat with this sentence "net user MyUser MyPassword /ADD" and I custom action to execute this. But this is not working. How can I create the user using a Custom Action?

Best regards,
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Create user and shared folder

Hello Mario,

You can use a "Launch file" custom action to run your BAT file during installation. Please take a look on the "Launch a CMD or BAT file" custom action and see if this helps you.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”