Registry and Files for current user - Advanced Installer Community
ml123
Posts: 21
Joined: Mon Jun 09, 2014 9:35 pm

Registry and Files for current user

Hi,
I created an installer for Office Add-On.
The setup requires administrator privilege for some prerequisites.
Problem is, after the user types the admin password, the files and registry are set for the admin, and not for the user running the installer (this is a per-user install).
For example, I have 2 users: admin (which is an admin...) and David, which is a Standard user.
David runs the installer, and asks admin to type in his password.
The installer then copies files in c:\users\admin\... instead of c:\users\David\...,
and writes registry values for admin instead of David, so that David actually cannot see the new Add-On, even though the installer told him the installation was successful.

What can be done to change this? I need the installer to put the files and the registry in the correct user context.

Thanks!
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Registry and Files for current user

Hi,

At first I would like to ask you if you are sure that the prerequisite setups are not requesting elevation by themselves. If yes, then you would not need elevation for your main package.

Otherwise, as a possible workaround, you can try to make a separate package with the prerequisites, and check the "Run as administrator" option in "Install Parameters" page.
Then, you can create your second (and final) package, uncheck the "Run as administrator" option, and in this package add as prerequisite the prior created prerequisites package.

Please let me know if this solved your problem.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ml123
Posts: 21
Joined: Mon Jun 09, 2014 9:35 pm

Re: Registry and Files for current user

I would really not want to create two packages...
Isn't there any other way to do that?
And if I'll have to - how can I run a 2nd package after the first one finished?
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Registry and Files for current user

Hello,

At the end, for the final user, there will only be one package to run.
The two packages that you create, help you only for the organization and for the separate elevation.

But still, if this solution does not fit your needs, there is a second workaround.
You would have to create a sequenced custom action of type "Launch file" for every prerequisite. For each of these custom actions you have to check the checkbox "Run as administrator".
You will have to place these actions in the Wizard Dialog Stage. You cannot add them in the Install Execution Stage, because Windows Installer cannot handle two installations in the same time (one being your main package, the second being the prerequisite package).
Please be aware that if running the main package with a limited or no UI, these custom actions will not run.

Having in sight these drawbacks, the recommended solution remains the first one I described.

If you have any other questions we'll be glad to answer them.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ml123
Posts: 21
Joined: Mon Jun 09, 2014 9:35 pm

Re: Registry and Files for current user

Hi Irina,

I might try the first solution.
How do I create two packages and execute them one after another?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry and Files for current user

Hello,

To do so you should just create two setup projects. Afterwards if you want, during installation, the second setup to be executed after the first one finished then you should add the second setup as a post-install prerequisite in the first setup project.

If you have any questions just let us know.

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

Return to “Common Problems”