luckyluke95
Posts: 10
Joined: Mon Apr 10, 2023 9:43 am

Optional updates without elevation

Dear community,

I just found out about Advanced Installer after having spent a lot of time investigating how to create a per machine install that can be updated without UAC elevation. Stumbling upon the relevant AI page https://www.advancedinstaller.com/user- ... dates.html made my day!
I have just one question to which I wasn't able to find an answer to even after searching the community. I apologize in advance if it was answered before.

On the beginning of the said page, it is stated that this functionality can only be enabled for projects with "Per machine only" installation types. I understand that the mechanism works by installing auto updater as a service, which requires elevated rights. That is all great. However, I was wondering if it was possible create an installer which has both "Per user" and "Per machine" options and then based on which option is chosen, install the auto updater either as a service or regularly. I am asking this because we would like to give users who do not have admin rights the ability to install the app as well and receive regular updates.

Thank you all in advance,
Luka
Catalin
Posts: 6600
Joined: Wed Jun 13, 2018 7:49 am

Re: Optional updates without elevation

Hello Luka and welcome to our forums,

To be fully honest with you, I do not think that would be achievable with a single setup.

However, what we can do is:

- create a per-machine version of your product where the updater is ran as a service

- create a per-user version of your product where the updater runs normally

After that, we can create an MSI wrapper over the two above. This would have the installation type set as "Per-machine if user is administrator, per-user otherwise" which will automatically add the "InstallTypeDlg" dialog in the "Dialogs" page.

The two packages above could be added in the wrapper as feature-based prerequisites and have their installation conditioned by what the user chooses in the "InstallTypeDlg", e.g. if the users chooses "per-user" then install the per-user version.

How to conditionally install a prerequisite based on the user selection?

Please note that this would require the "Enterprise" suite of Advanced Installer.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
luckyluke95
Posts: 10
Joined: Mon Apr 10, 2023 9:43 am

Re: Optional updates without elevation

Hello Catalin,

Thank you for the answer. It is quite an interesting solution. I played around with it today and if the prerequisite installers are set to be executed silently, it is almost a seamless solution (apart from a double admin prompt but that should be fine). The doubling of the size of the installer should be fine as well.

The only outstanding issue is that after installation I am left with two installed app, the wrapper which is a dummy and one of the prerequisites which is the main one. It is not a problem in general as it shouldn't affect functioning of the main app, however it does install sort of a "phantom" app which will probably be raised by some of our enterprise clients. Is there a nicer way of solving the issue apart from somehow running a script post install which will uninstall the wrapper app?

Thanks again for your ingenious solution and I appreciate any further assistance.

Cheers,
Luka
Catalin
Posts: 6600
Joined: Wed Jun 13, 2018 7:49 am

Re: Optional updates without elevation

Hello Luka,

You are always welcome! :)

We can easily get rid of the "phantom" app from the Control Panel by unchecking the "Register with Windows Installer" option on our "bootstrapper" in the "Product Details" page:
Screenshot_111.png
Screenshot_111.png (89.36 KiB) Viewed 4538 times
Screenshot_112.png
Screenshot_112.png (56.22 KiB) Viewed 4538 times

This way, our bootstrapper should no longer appear in the Control Panel.

In addition to that, to make things even cleanier, please go to "Registry" page and remove the entries from there. There are some entries that we create for every project.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”