杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1926|回复: 0

NSIS 改变字体大小

[复制链接]
发表于 2017-2-26 13:40:42 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. ;NSIS Modern User Interface
  2. ;Multilingual Example Script
  3. ;Written by Joost Verburg

  4. ;--------------------------------
  5. ;Include Modern UI

  6. !include "MUI.nsh"

  7. ;--------------------------------
  8. ;General

  9. ;Name and file
  10. Name "Modern UI Test"
  11. OutFile "MultiLanguage.exe"

  12. ;Default installation folder
  13. InstallDir "$PROGRAMFILES\Modern UI Test"

  14. ;Get installation folder from registry if available
  15. InstallDirRegKey HKCU "Software\Modern UI Test" ""

  16. ;--------------------------------
  17. ;Interface Settings

  18. !define MUI_ABORTWARNING

  19. ;--------------------------------
  20. ;Language Selection Dialog Settings

  21. ;Remember the installer language
  22. !define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
  23. !define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
  24. !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

  25. ;--------------------------------
  26. ;Pages

  27. !define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeMainFont
  28. !insertmacro MUI_PAGE_LICENSE $(MUILicense)
  29. !define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeFont2
  30. !insertmacro MUI_PAGE_COMPONENTS
  31. !define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeFont
  32. !insertmacro MUI_PAGE_DIRECTORY
  33. !insertmacro MUI_PAGE_INSTFILES

  34. !insertmacro MUI_UNPAGE_CONFIRM
  35. !insertmacro MUI_UNPAGE_INSTFILES

  36. ;--------------------------------
  37. ;Languages

  38. !insertmacro MUI_LANGUAGE "English" # first language is the default language
  39. !insertmacro MUI_LANGUAGE "SimpChinese"
  40. !insertmacro MUI_LANGUAGE "TradChinese"

  41. ;--------------------------------
  42. ;License Language String

  43. LicenseLangString MUILicense ${LANG_ENGLISH} "${NSISDIR}\Docs\Modern UI\License.txt"
  44. LicenseLangString MUILicense ${LANG_SIMPCHINESE} "${NSISDIR}\Docs\Modern UI\License.txt"
  45. LicenseLangString MUILicense ${LANG_TRADCHINESE} "${NSISDIR}\Docs\Modern UI\License.txt"

  46. ;--------------------------------
  47. ;Reserve Files

  48. ;These files should be inserted before other files in the data block
  49. ;Keep these lines before any File command
  50. ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)

  51. !insertmacro MUI_RESERVEFILE_LANGDLL

  52. ;--------------------------------
  53. ;Installer Sections

  54. Section "Dummy Section" SecDummy

  55. SetOutPath "$INSTDIR"

  56. ;ADD YOUR OWN FILES HERE...

  57. ;Store installation folder
  58. WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR

  59. ;Create uninstaller
  60. WriteUninstaller "$INSTDIR\Uninstall.exe"

  61. SectionEnd

  62. ;--------------------------------
  63. ;Installer Functions

  64. Function .onInit

  65. !insertmacro MUI_LANGDLL_DISPLAY

  66. FunctionEnd

  67. ;--------------------------------
  68. ;Descriptions

  69. ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC

  70. ;Assign descriptions to sections
  71. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  72.    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} "A test section."
  73. !insertmacro MUI_FUNCTION_DESCRIPTION_END


  74. ;--------------------------------
  75. ;Uninstaller Section

  76. Section "Uninstall"

  77. ;ADD YOUR OWN FILES HERE...

  78. Delete "$INSTDIR\Uninstall.exe"

  79. RMDir "$INSTDIR"

  80. DeleteRegKey /ifempty HKCU "Software\Modern UI Test"

  81. SectionEnd

  82. ;--------------------------------
  83. ;Uninstaller Functions

  84. Function un.onInit

  85. !insertmacro MUI_UNGETLANGUAGE

  86. FunctionEnd

  87. Function ChangeFont
  88. FindWindow $0 "#32770" "" $HWNDPARENT ;$0 保存主窗口句柄
  89. GetDlgItem $R0 $0 1001
  90. CreateFont $R1 "宋体" 9 0  ;浏览按钮字体
  91. SendMessage $R0 ${WM_SETFONT} $R1 0
  92. GetDlgItem $R0 $0 1006
  93. CreateFont $R1 "宋体" 15 0  ;安装目录选择页面 字体
  94. SendMessage $R0 ${WM_SETFONT} $R1 0
  95. FunctionEnd

  96. Function ChangeFont2
  97. FindWindow $5 "#32770" "" $HWNDPARENT
  98. GetDlgItem $R5 $5 1032
  99. CreateFont $R2 "宋体" 11 0   ;组件选择名称字体
  100. SendMessage $R5 ${WM_SETFONT} $R2 0
  101. GetDlgItem $R5 $5 1042
  102. SendMessage $R5 ${WM_SETFONT} $R2 0
  103. FunctionEnd

  104. Function ChangeMainFont
  105. FindWindow $2 "#32770" "" $HWNDPARENT
  106. CreateFont $R2 "宋体" 104 0
  107. GetDlgItem $R5 $2 1
  108. SendMessage $R5 ${WM_SETFONT} $R2 0
  109. GetDlgItem $R6 $2 2
  110. SendMessage $R6 ${WM_SETFONT} $R2 0
  111. GetDlgItem $R6 $2 3
  112. SendMessage $R6 ${WM_SETFONT} $R2 0
  113. FunctionEnd
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-19 13:10 , Processed in 0.105688 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表