@ledsun blog

無味の味は佳境に入らざればすなわち知れず

WiX Toolsetの組み込みダイアログのフォントを指定する

WiX チュートリアル 日本語訳 Lesson 2 ユーザー・インタフェイス / 1. 最初のステップにある、Sample-2-1-WixUI.zipWixUI_InstallDirという組み込みのダイアログセットを使っています。

WixUI_InstallDirを使っているというのは、wxsファイル中に次の要素があります。

<UIRef Id="WixUI_InstallDir" />

この要素の実体はhttps://github.com/wixtoolset/wix3/blob/b496a8fdc2979c9a8e70edd3a47f2e98fc178e9e/src/ext/UIExtension/wixlib/WixUI_InstallDir.wxs#L28-L79で定義されているUI要素です。 29~31行目にフォントの指定があります。

<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

f:id:ledsun:20220123181820p:plain
デフォルトのフォントはTahoma

このUI要素をwxsファイル中に展開すると、好きなフォントが指定できます。

フォントの変更作業

<UIRef Id="WixUI_InstallDir" />

を、上記のリンクに置き換えます。 このとき

<UIRef Id="WixUI_Common" />

を入わすれると、次のエラーが発生します。

PS C:\Users\led_l\wix-play-ground\Sample-2-1-WixUI> light.exe -cultures:ja-JP -ext WixUIExtension .\SampleWixUI.wixobj
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

C:\agent\_work\66\s\src\ext\UIExtension\wixlib\ResumeDlg.wxs(10) : error LGHT0197 : The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown.  Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixUICostingPopupOptOut=some value which doesn't contain parenthesis).
C:\agent\_work\66\s\src\ext\UIExtension\wixlib\ResumeDlg.wxs(19) : error LGHT0197 : The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown.  Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixUICostingPopupOptOut=some value which doesn't contain parenthesis).
C:\agent\_work\66\s\src\ext\UIExtension\wixlib\LicenseAgreementDlg.wxs(20) : error LGHT0197 : The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown.  Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixUICostingPopupOptOut=some value which doesn't contain parenthesis).
C:\agent\_work\66\s\src\ext\UIExtension\wixlib\MaintenanceWelcomeDlg.wxs(10) : error LGHT0197 : The Windows Installer XML variable !(wix.WixUICostingPopupOptOut) is unknown.  Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.WixUICostingPopupOptOut=some value which doesn't contain parenthesis).

フォント指定を変更します。例えば

<TextStyle Id="WixUI_Font_Normal" FaceName="Veradana" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Veradana" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Veradana" Size="9" Bold="yes" />

に置き換えます。 ビルドすると文字が全体的に、横長になります。

f:id:ledsun:20220126063923p:plain
フォントをVeradanaに変更した

FaceNameとしてどのような値が設定出来るか謎です。 VeradanaはTortoiseGitのインストーラーで使われているのを発見しました。

ライセンスはどうなる?

WiX Toolsetのソースコード(設定ファイル?)を流用したのでライセンスが気になります。 https://wixtoolset.org/about/license/ によるとWiX ToolsetのライセンスはMicrosoft Reciprocal License (MS-RL)です。

ちゃんと読んでいませんがシェアードソース - Wikipediaによると

修正されたソースファイルの同梱およびMs-RLが維持されるかぎり、派生コードの再頒布が認められる

Ms-RLになりそうです。 ライセンス自体は、そもそもリンクする時点で気にする必要があったように思います。 インストーラーのライセンスがどういうものなのか考えたことがありませんでした。

参考

Customizing Built-in WixUI Dialog Sets