bhawkins
Posts: 19
Joined: Thu Apr 05, 2012 3:54 pm

Elevated Rights for runnin gthe Program on Installation

Hello,

The situation is specific to Vista computers that are installing the demo software.

I have an application Demo installation that will give the user the option to automatically launch the newly installed application.

When the application is first ran, it does create folders and a database (within the application first time run NOT in the Installation routine). This is created in the [AppData] folder.

Problem that I am having is that the first time it runs fine ... however when the application is run the second time I get an error that the file that was created to direct the user to their data .. access is denied to it. Upon investigation the folder and files are marked readonly for this user. This is the same user that installed the program originally.

If I install and decide NOT to automatically run the Application during the installation ... This problem is NOT encountered.

-------------------------------------------

My question is this: When the Program is auto launched from the Installer, it is run at an elevated user level?

Or is there any other reason this could be occuring.

Thanks.

Cheers,
Bruce
bhawkins
Posts: 19
Joined: Thu Apr 05, 2012 3:54 pm

Re: Elevated Rights for runnin gthe Program on Installation

Hello,

So some more information:

Option for Run As Administrator is checked

I get prompted for the Administrator password (since limited user is logged in).

I confirmed again ... that if I run from Setup .. the program created folders and files are read only to that limited user. More importantly the Security for those files do NOT have Modify checked . .they can be read however.

If i only close the setup and then run the program via the shortcuts created .. I do not get his problem and the files created are accessible.

Hope this helps provide more information.

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

Re: Elevated Rights for runnin gthe Program on Installation

Hi Bruce,
When the Program is auto launched from the Installer, it is run at an elevated user level?
Yes it is, since you have the "Run As Administrator" option enabled.

You can try to disable that option and see if the problem persists.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bhawkins
Posts: 19
Joined: Thu Apr 05, 2012 3:54 pm

Re: Elevated Rights for runnin gthe Program on Installation

Mihai,

Thanks for the response.

Two situations with this:

1) We have a user that is installing with Admin equivalence and we have an install with must run as Administrator. If the program is launched by the setup .. the folders created by the program are marked for Admin only .. thus when the next time the program is run .. I get an error.

If the program is not auto run after the installation .. there is no problem.

2) Limited user installing. This situation, the user has to enter Administrator credentials ... which is fine. However, if the application is auto run after install ... the program is run as Administrator and thus the next time the program is run by them, it gives error as those files created are not accessible by this user.

Hope this helps clear up the situation I am facing.

Right now the solution is to NOT ever allow the user to auto run after installation.

This solves the problem, however, it is not what I wish to offer the users. Standard is to allow auto run.

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

Re: Elevated Rights for runnin gthe Program on Installation

Hi Bruce,

Both cases should be handled correctly if you disable the "Run As Administrator" option. This option is mostly used when having several prerequisites to avoid multiple elevations, browse IIS, etc.

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: Elevated Rights for runnin gthe Program on Installation

Generally, the process that launches the application inherits the rights of the parent process that lunches it. In your case that is the install process.

I added an improvement regarding this on our TODO list so our development team can consider, investigate and optimize the behavior.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bhawkins
Posts: 19
Joined: Thu Apr 05, 2012 3:54 pm

Re: Elevated Rights for runnin gthe Program on Installation

Thanks for the responses :-)

To get around this ... I have created the folders within the Installer (Files and Folder section) - able to do this since the folder is within the Common AppData location. This is the same location that I default within the application.

I add the folder and give it permissions for everyone - all rights. Now it does not matter if Admin user is the initial user or not.

I had this code in the application as I thought that the folders in this would inherit the folder permissions - not so in the case that the initial user is actually elevated to Admin user.

--------------------------------------------

I understand the reason the application is running under the elevated Admin user .. however I think you understand why I thought that the wizard should not launch the application in that same mode.

I hope this helps others as well.

Cheers,
Bruce

Return to “Common Problems”