Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Run As Administrator from Finish Dialog?

Hello,

How to run the application from Finish dialog's run program check box or button to run the program as Administrator?

Regards

:)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run As Administrator from Finish Dialog?

Hello,

In order to achieve that you should go first in the “Custom Actions” page and add a Launch file predefined custom action without sequence and enable the “Run As Administrator” option. In the custom action properties edit the “File To Lauch” field to your file that you want to be lauched(e.g. [#My_File.exe] ).

You can go now in the “Dialogs” page, on the “ExitDialog” select the [Finish] button and add a Published Event using the [New] button. From the New Control event dialog that had appeared you can select “Execute custom action” option and from the “Argument” list just select the “LaunchFile” option. Also you should add in the “Condition” field the property of the checkbox(e.g. RUNAPPLICATION ). So, the published event will be executed only if the “launch application” option is enabled.

You can also take a look on the Execute custom action on push button article which may be useful to you.

If you have any questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Run As Administrator from Finish Dialog?

Hello,

Thanks :D, it helped a lot. How to make the Finish dialog run application to run with the current user's privileges instead of Administrator? Because, the installer runs the Finish dialog run application based on the the UAC setting set in "Install Parameters". The custom action you mentioned is great for Admin run. But how to make it run with current user's access privileges?

Regards

:)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run As Administrator from Finish Dialog?

Hello,

In order to achieve that is enough to not enable the “Run as administrator” option from the previously added “Launch file” custom action properties.
So, your custom action will run with current user's access privileges.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Run As Administrator from Finish Dialog?

Hello,

Thanks for your information. The installer needs to run as administrator because it has to update over few files that requires admin rights. Is it possible to set the level of file from the "Permissions" tab in the file's property to make it not run as admin?

Regards

:)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run As Administrator from Finish Dialog?

Hello,

I'm afraid I don't fully understand what is your scenario. Can you give us more details about your scenario (maybe exemplify)?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Run As Administrator from Finish Dialog?

Hello,

This is not the first version of the installer. I mean it is not 1.0, but it is 2.0. So, the installer has to overwrite the previous program files if the previous version is found. This does not correctly happen (update with new files) if there is no admin rights. When the new installer is copying new files the main executable file gets removed from the old version but the new version does not gets installed. Only way for the installer to properly update all the files is o run the installer with admin rights. However, since the installer is running with admin rights whether from the installer's options or by right-click and "Run As Administrator" menu item, it executes the main program with admin rights when opened from the Finish dialog.

The way the program is designed it must not have admin rights to run. If we run with admin rights it will disable few functions. This must not happen. Of course the program works fine when running from the shortcut. But if we run it from Finish dialog, it is executed with admin rights.

So the installer needs to run with admin rights. This is working fine. But when the program is opened from Finish dialog it must not have the same admin rights as the installer.

Regards

:)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run As Administrator from Finish Dialog?

Hello,
This is not the first version of the installer. I mean it is not 1.0, but it is 2.0. So, the installer has to overwrite the previous program files if the previous version is found. This does not correctly happen (update with new files) if there is no admin rights. When the new installer is copying new files the main executable file gets removed from the old version but the new version does not gets installed.
This behaviour may be caused by a known Windows Installer bug. You can take a look on our DLL file disappears during an upgrade thread which debates a similar subject.

As a workaround can you enable the “Always overwrite existing file” option from the “Operations” tab from the related files properties and see if the behavior still persist?

The custom action which will launch your application will have the execution level "As Invoker" default so there is no need to enable the “Run As Admin” option from the custom action properties. If your application will be launched from a standard account the custom action will have the same execution level.

To prevent the application from elevating to administrator level you should also disable the “Run as administrator” option from the “Install Parameters” page and you should not launch the installation package using the "Run as administrator" context menu option.

Please let us know if that helped otherwise give us more details.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Run As Administrator from Finish Dialog?

Hello,
This behaviour may be caused by a known Windows Installer bug. You can take a look on our DLL file disappears during an upgrade thread which debates a similar subject.

As a workaround can you enable the “Always overwrite existing file” option from the “Operations” tab from the related files properties and see if the behavior still persist?
This may work. I'll try it out and notify you.

Thanks

:D
K
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Run As Administrator from Finish Dialog?

Hello,
This behaviour may be caused by a known Windows Installer bug. You can take a look on our DLL file disappears during an upgrade thread which debates a similar subject.

As a workaround can you enable the “Always overwrite existing file” option from the “Operations” tab from the related files properties and see if the behavior still persist?
Worked Perfectly.

Thanks

:D
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run As Administrator from Finish Dialog?

You're welcome. I'm glad you got this working.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bnsgroup
Posts: 10
Joined: Tue Aug 28, 2012 10:59 am

Re: Run As Administrator from Finish Dialog?

I have followed the instructions in this article to run my app elevated after pressing the close button on the final dialog however my app does not get the elevated privileges it requires, THE UAC prompt does not come up. I am running the current version of AI 11.4.1 build 58484. Can send you my aip offline to the forum for you to look at.

Clive
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run As Administrator from Finish Dialog?

Hi Clive,

Yes, you can send us your AIP file to support at advancedinstaller dot com, so we can take a look of it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”