私はNSIS アンインストーラー ページのカスタマイズについて調査を行い、ウェルカムページと終了ページである程度の成功を収めました。
ただし、ウェルカム ページで行ったのと同じテンプレートを確認ページで使用するのに問題があります。ゼロ以外の値でnsDialogs を使用してコントロールを追加するとheight
、確認ページの既存のコントロール (ヘッダーとボタンを除く) がすべて消えます。
これが私のコードです(ボタン名は正常に更新されますが、そのページの他のすべてのコントロールが削除されます)
!include MUI2.nsh
OutFile "CustomUninstaller.exe"
InstallDir "C:\Program Files (x86)\NSIS\Examples\CustomFinish"
!define APPNAME "Testing"
Name "${APPNAME}"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ModifyUnConfirm ; My custom function for the Confirm page
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Function un.ModifyUnConfirm
# Change "Uninstall" button to say "Continue" on uninstaller confirmation page
GetDlgItem $0 $HWNDPARENT 1
SendMessage $0 ${WM_SETTEXT} 0 "STR:Continue"
# Add new label. If these three lines are commented out, I see the regular controls of this page show up.
# The position, color and background of the label don't seem to matter
${NSD_CreateLabel} 50% 50% 100% 10u "Testing!!!"
Pop $0
SetCtlColors $0 "" ${MUI_BGCOLOR}
FunctionEnd
Section TestUninstaller
WriteUninstaller "$INSTDIR\unCustomUninstaller.exe"
ExecWait "$INSTDIR\unCustomUninstaller.exe"
Sectionend
質問:
- コントロールが消える理由を誰か知っていますか?
- このページにコントロールを正常に追加するには、何をする必要がありますか?