Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Deploy your own application custom font before setup UI initializes

Tue May 30, 2023 10:42 am

Hi,

Hereby I expose the configuration of a setup package that will use same custom font (for setup dialogs) as the one used by your application.

Often, applications make use of a custom font. To do so the custom font have to be deployed using your setup package. This is fairly easy to configure, have a look "How do I register a Font?" article.

Now to have a consistent user experience you may want to use the same application custom font for the UI dialogs of your setup package. To do so you should make sure the font is deployed before the setup UI initializes. For instance you can create a separate setup package that will simply deploy the application font and make sure this package is installed using a custom action just before the UI dialogs of the main setup package are displayed.

Attached you can find a sample implementing this configuration.
sample.zip
(625.32KiB)Downloaded 1327 times

Here are the detailed configuration steps you can go with:

1. create a setup package that will simply deploy your application custom font; just follow the steps exposed in "How do I register a Font?" article.

2. open your main setup project and go to "Files and Folders" page; add the above fontSetup package as a temporary file
screen1.jpg
screen1.jpg (90.7KiB)Viewed 236443 times

3. go to "Custom Actions" page and add a new "Run PowerShell Inline Script" custom action without sequence that will simply launch and silently install the fontSetup package; you can use a PowerShell code like this:

Code: Select all

$arguments = "/i `"" + $env:TEMP + "\fontSetup.msi`" /qn"
Start-Process -FilePath msiexec.exe -ArgumentList $arguments -Wait
screen2.jpg
screen2.jpg (185.96KiB)Viewed 236443 times

4. go to "Dialogs" page and select "PreparePrereqDlg" dialog; add a trigger for the above configured "InstallFont" custom action on "Init Event" tab - let's assume your main setup project also includes pre-install prerequisites; otherwise you can trigger this action from "PrepareDlg" dialog
screen3.jpg
screen3.jpg (149.35KiB)Viewed 236443 times

5. go to "Install Parameters" page and make sure you check "Run as administrator" option

6. finally go to "Themes" page -> Text Styles" tab and set for the default text style your custom font (the custom font must be already installed on current build machine in order to be able to select it in "Text Styles" tab)
screen4.jpg
screen4.jpg (137.11KiB)Viewed 236443 times

7. save and rebuild your main setup project

That was all!

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”