audrey_25
Posts: 1
Joined: Mon Dec 05, 2022 6:27 pm

Skip Font Installation when the install is launched by a normal user

Hi,
I'm in the process of converting our installers from .msi to .exe bootstrapper. I'm having problem converting our only installer that can be installed by a normal user (per-user). When I run the installer in a normal user account, there's always a UAC prompt that is shown after clicking on install.
I've notice that the problem is linked to the installation of a font on the client computer. Until now, we were using a feature to be able to limit the font installation to admin accounts only but that technique doesn't work when "Use Enhanced User Interface" is activated.

I want to know if it is possible to install a font only in admin in a mixed-mode installer?

When I disable "Use Enhanced User Interface", the installer works correctly. However, I would really like to use the "Enhanced User Interface" to have access to all the new features.

I've attached to this post a .zip file containing an .aip that you can use to reproduce the problem.

Thanks,
Audrey
Attachments
Unique Font.zip
(28.68 KiB) Downloaded 118 times
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Skip Font Installation when the install is launched by a normal user

Hello Audrey and welcome to our forums,

In order to achieve your desired scenario, you need to add the font to the Application Folder, or you can add it as a temporary file. If you add the font to the Windows Volume/Windows location, then the expected behavior is to request privileges (a standard user cannot access this location). Currently our Register font support works only for packages with Administrator privileges. If the package is "Per user only" then the font registration fails.

However, Microsoft supports installing fonts without privileges. As of Windows 10 version 1803 (released in April 2018), non-admin font installation was added.

Installing fonts in Windows without administrative privileges results in the font being installed as a user font, not as a system-wide font. Doing this via a script automatically chooses the right folder if it didn’t have the necessary privileges.

Therefore, you can choose to install your font using our custom action support (the font will be automatically redirected based on the user privileges) or you can make the below changes to your project. For the custom action approach you can check the How Can I Install Fonts Using a Script? article.

1. Add the font to the Application Folder or add it as a temporary file.

2. Check the "Register font" option from the Registration tab.

3. Go to the Custom Actions page, right click on the Add resources action group --> Show Standard Action --> Add Resources --> and click on the RegisterFonts action.
registerfonts.png
registerfonts.png (495.16 KiB) Viewed 8186 times

4. On the condition field of the RegisterFonts custom action add the AI_INSTALLPERUSER = "0" condition. In this way, the font will be registered only when the "Everybody (all users)" option is selected.

Attached you can find my sample project. Feel free to have a look on it.

Let me know if you have any questions.

Best regards,
Liviu
Attachments
RegisterFont.aip
(22.88 KiB) Downloaded 118 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”