netrustPS
Posts: 40
Joined: Tue Dec 20, 2016 4:40 am

Install patch via Updater without elevation forces reboot without prompt

Environment: The full installer installs the support service and patches for the application are set to be installed without elevation. They have also been marked as patch and not a full package.

Observation: When the patch is installed via the Updater whether it is with UI or not, there will be a force reboot without prompt if any resources are locked during the time of installation. E.g. if the program is still open.

Question 1: How do we remedy this situation? Ideally, if resources are locked at that point in time there should be a prompt to ask to reboot rather than a force reboot. Is this because of the install without elevation checkbox? Do I have any alternatives if we still want the updates to be installed without human interaction?

Question 2: Is there any way to set the updater such that only my application is able to trigger it? Currently it is being triggered by command line but the updater can be double clicked and launched by the user. This is related to question 1 as the application can guarantee that it is closed before starting the update process but not if it is user triggered. Our expected work flow expects users to update via our app not via the updater exe.

Note: Currently unable to use the Auto Close Applications function in the updates project because the application already has a use for the WM_CLOSE message. It is possible for us to make changes to our application but we would like to explore other alternatives first being going down that road.

Thanks!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install patch via Updater without elevation forces reboot without prompt

Hello,
Question 1: How do we remedy this situation? Ideally, if resources are locked at that point in time there should be a prompt to ask to reboot rather than a force reboot. Is this because of the install without elevation checkbox? Do I have any alternatives if we still want the updates to be installed without human interaction?
The recommended approach to avoid this situation will be to close your application (or the all the processes which could keep in use your product files) during installation. For this you can use a "Stop process" custom action in your installations setups.

Also, I don't think this behavior is influenced by our Updater as a service option.
Question 2: Is there any way to set the updater such that only my application is able to trigger it? Currently it is being triggered by command line but the updater can be double clicked and launched by the user. This is related to question 1 as the application can guarantee that it is closed before starting the update process but not if it is user triggered. Our expected work flow expects users to update via our app not via the updater exe.
I'm afraid we don't have support for this.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
netrustPS
Posts: 40
Joined: Tue Dec 20, 2016 4:40 am

Re: Install patch via Updater without elevation forces reboot without prompt

Hi Daniel,

Thanks for your suggestion. I have added the custom action and my application process now terminates before the installer starts to install/patch anything.
Also, I don't think this behavior is influenced by our Updater as a service option.
As for the install without elevation option it played a part in the behavior I encountered based on my testing. With the option set the installation would proceed without any GUI, if resources are locked it will automatically force reboot when the installation is complete. Without the option set the installation would proceed with GUI and I will get to choose to close the application and restart it later or reboot my machine at the end. So I am not sure if the force reboot when resources are locked is the intended behavior of this function.
I'm afraid we don't have support for this.
Could you consider supporting this in the future? The use case for this is as follows.

The update process needs to be triggered from the application itself due to business rules. E.g. if there are certain critical sub processes that must end before the program can be terminated etc. If the update process can be triggered ONLY from the application itself, this can be enforced.

However the updater exe can be triggered by double clicking the updater exe and following the GUI instructions to install updates. A setting can be added in the project that lets the default behavior of double clicking the updater exe to inform the user to update through the application instead, instead of running the /checknow flag behavior as of the present. The intended purpose of this step is to deter simple users with itchy fingers from triggering the update process unexpectedly.

To take it one step further, a password could be set in the project such that only command line executions of the updater exe with a valid password could make it function. This will prevent anyone other than the application from triggering the updater exe.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install patch via Updater without elevation forces reboot without prompt

Hello,

You're always welcome.
As for the install without elevation option it played a part in the behavior I encountered based on my testing. With the option set the installation would proceed without any GUI, if resources are locked it will automatically force reboot when the installation is complete. Without the option set the installation would proceed with GUI and I will get to choose to close the application and restart it later or reboot my machine at the end. So I am not sure if the force reboot when resources are locked is the intended behavior of this function.
This is the intended behavior of Windows Installer. The difference between your tested scenarios is the UI level of the installation. During a silent installation Windows Installer requires a reboot after installation (if there are resources in use), while during a full UI installation the user is prompted with the "FileInUse" dialog where he can choose to close the processes keeping the related files in use or to prompt for a reboot after installation.
Could you consider supporting this in the future? The use case for this is as follows.

The update process needs to be triggered from the application itself due to business rules. E.g. if there are certain critical sub processes that must end before the program can be terminated etc. If the update process can be triggered ONLY from the application itself, this can be enforced.

However the updater exe can be triggered by double clicking the updater exe and following the GUI instructions to install updates. A setting can be added in the project that lets the default behavior of double clicking the updater exe to inform the user to update through the application instead, instead of running the /checknow flag behavior as of the present. The intended purpose of this step is to deter simple users with itchy fingers from triggering the update process unexpectedly.

To take it one step further, a password could be set in the project such that only command line executions of the updater exe with a valid password could make it function. This will prevent anyone other than the application from triggering the updater exe.
Thank you for your suggestion. I've forwarded this to our development team and maybe we will consider such an improvement in the future.

As a workaround, you can host the updates files (updates config file and the updates setup) onto a web server which requires authentication. This way all the Updater executions by any third party will be unsuccessful. When the updates files are hosted on a web server which requires authentication the Updater will first prompt for the credentials so it can download the updates files. Also, to avoid the credential prompt when the Updater is called from by your application you can use into your app code a URL with the credentials embedded.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
netrustPS
Posts: 40
Joined: Tue Dec 20, 2016 4:40 am

Re: Install patch via Updater without elevation forces reboot without prompt

Hi Daniel,
This is the intended behavior of Windows Installer. The difference between your tested scenarios is the UI level of the installation. During a silent installation Windows Installer requires a reboot after installation (if there are resources in use), while during a full UI installation the user is prompted with the "FileInUse" dialog where he can choose to close the processes keeping the related files in use or to prompt for a reboot after installation.
Noted on this. Thanks for the explanation.
As a workaround, you can host the updates files (updates config file and the updates setup) onto a web server which requires authentication. This way all the Updater executions by any third party will be unsuccessful. When the updates files are hosted on a web server which requires authentication the Updater will first prompt for the credentials so it can download the updates files. Also, to avoid the credential prompt when the Updater is called from by your application you can use into your app code a URL with the credentials embedded.
For this it is unlikely I can request for a password to be put on our web server, not without breaking a few other things in the process anyway. But I will keep this in mind in case we setup a new web server for our installer hosting. Do let me know if my suggestion will be implemented as a new feature in the future, thanks.

Return to “Building Installers”