Install with elevation question - Advanced Installer Community
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Install with elevation question

We love the "updates without elevation" feature that is included in AI. We have built an Auto Update feature into our app that means that after the initial installation by an IT Admin the user can install updates without Admin privileges elevation. So this is perfect.

However, there may be stubbron IT departments would prefer to not have this "update without elevation". That is, they may want to require Admin credentials each time a new release is available; and thus not allow a limited user to install any future updates. Using the same Setup exe what properties would I need to change in my AIP project to bind a new checkbox on one of my custom dialog screens so that when clicked it can flag the systems so that future update installs require Admin elevation.

Basically, I need to add a feature to my installer that acts as a toggle between two scenarios "Allow updates without Admin elevation" vs "Require Admin permissions to install updates".

Thanks.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install with elevation question

Hello,

In order to achieve that you can go in the Table Editor page and condition the execution of the AI_UPDATER_SERVICE_CONFIG action from the InstallExecuteSequence table.

For example you can add a checkbox on a dialog and the public property which has been assigned to the control, add it in the condition field of the custom action.
e.g.

Code: Select all

( ( ( NOT Installed AND VersionNT) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" AND VersionNT) ) AND ($updater.exe = 3) ) AND CHECKBOX_1_PROP 
Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Install with elevation question

Hello,
Ok, I will try this. Question though: I did choose to rename my updater.exe file to something less generic (like "PMOvtrUpdater.exe"), does that mean I have to change the code to something like this?

( ( ( NOT Installed AND VersionNT) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" AND VersionNT) ) AND ($PMOvtrUpdater.exe = 3) ) AND CHECKBOX_1_PROP


Also, can you tell me what the net effect is for doing this? I assume that it disables the Updater service from being installed, and therefore there are no checks that occur to see if a new release has been published, is that correct?

Thanks!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install with elevation question

Hello Kevin,
Ok, I will try this. Question though: I did choose to rename my updater.exe file to something less generic (like "PMOvtrUpdater.exe"), does that mean I have to change the code to something like this?
All you have to do is to add a property to the Condition field of the AI_UPDATER_SERVICE_CONFIG custom action from the InstallExecuteSequence table and let the rest unchanged.
You can also take a look on the Make "install support service" for updates optional ? forum thread which debates a similar subject.
Also, can you tell me what the net effect is for doing this? I assume that it disables the Updater service from being installed, and therefore there are no checks that occur to see if a new release has been published, is that correct?
Using this approach you condition the configuration of the updater's service for installing updates without elevation. The updater will work accordingly, the only difference is when installing an update, there will be the elevation prompt.

If you have any questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Install with elevation question

Hi,
I am seeing a new problem that I could use help with; I suspect it is related to the AI_UPDATER_SERVICE_CONFIG changes we have been discussing here, because I had not seen the problem before. Mind you it has been a little while since I have gotten back to testing this specific area.

The Advanced Updater is failing with the message: "Some of the updates failed to install properly". The updater log file that was auto-generated is also attached. Could this be related to Table Editor > InstallExecuteSequence > AI_UPDATER_SERVICE_CONFIG changes recommended above?

I have also attached the original good installation MSI log file, prior to the Updater service attempting to apply the available update.

Thanks.
Attachments
MSIa19bb.LOG
(798.11 KiB) Downloaded 588 times
Auto Update Error 1603.txt
(3.73 KiB) Downloaded 429 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install with elevation question

Hi Kevin,
The Advanced Updater is failing with the message: "Some of the updates failed to install properly".
Any update defined in the Updates Configuration file uses a detection criteria. This criteria is usually a file or a registry entry which contains the package version. If it's not met after the update is installed, the Updater will show this message. Therefore, you need to make sure you specified a correct file or registry entry in the Installed Detection section of the Update Properties page.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Install with elevation question

Hi,
Ok, I will look into that. I'm assuming that if I'm doing a registry search that the "Updates > Properties > Installed Detection > Expected Value" it should find to determine if it's already installed is the "most current" version I am publishing. In other words, if I install "14.06.90" and then the publish "14.06.91" as an update, the "Expected Value" entry in this screen should be "14.06.91", is that correct?
And, should I include the leading zeros? Or, "14.6.91"

[EDIT: this whole next section is new]
As you can see in these images, I have the reg key "14.06.90" that should be found to be less than the "Installed Detection" value of "14.06.91" when I publish that version. So why am I still getting the same 1603 error which is causing the updater.exe to fail?
RegKeysAfterInstall.png
RegKeysAfterInstall.png (27.74 KiB) Viewed 8937 times
RegKeyVersionDetection.png
RegKeyVersionDetection.png (17.53 KiB) Viewed 8946 times
Thanks.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install with elevation question

Hi Kevin,
Ok, I will look into that. I'm assuming that if I'm doing a registry search that the "Updates > Properties > Installed Detection > Expected Value" it should find to determine if it's already installed is the "most current" version I am publishing. In other words, if I install "14.06.90" and then the publish "14.06.91" as an update, the "Expected Value" entry in this screen should be "14.06.91", is that correct?
Indeed, the expected value in the Expected Value field from the Configuration Project should be 14.06.91.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Install with elevation question

Hi,
Ok back to my original goal, I have tried setting the
Table Editor > InstallExecuteSequence table > AI_UPDATER_SERVICE_CONFIG action
and this did seem to help:

Code: Select all

( ( ( NOT Installed ) OR ( Installed AND REMOVE <> "ALL" AND AI_INSTALL_MODE <> "Remove" ) ) AND ($updater.exe = 3) ) AND CHECKBOX_1_PROP <> "No"
NOTE: I had to add the

Code: Select all

CHECKBOX_1_PROP <> "No"
because I have my checkboxes setup on the dialog screen to be "No" when off and "Yes" when on so that they write those exact strings to the INI file as we needed.

The end result is good. If the Adminstrator turns off the "allow all users to install automatic updates" then when a limited user tries to do the automatic update they are prompted by UAC to provide admin credentials...perfect!!
Thanks.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install with elevation question

You're welcome Kevin,

I'm glad you got this working. If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”