使用 NSIS 创建自定义页面
Create custom page with NSIS
我想使用 nsis 创建自定义页面。只是文本,在不同的高度和可能的一些图像。类似于 oracle 所做的事情:
从 docs at "Custom Pages" 这是创建自定义页面的方式:
;--------------------------------
;Pages
Function CustomPageFunction
!insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
FunctionEnd
!insertmacro MUI_PAGE_WELCOME
Page custom CustomPageFunction
我正在寻找有关如何创建非常基本的自定义安装程序页面的其他指南,因为不幸的是,在 MUI_PAGE_WELCOME 之后没有显示带有 "TITLE" 和 "SUBTITLE" 的新页面,就像额外的一样需要添加说明。我错过了什么?ž
设置图像的更新:
var Image
var ImageHandle
Function CustomPageFunction
; !insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
nsDialogs::Create 1044
Pop [=11=]
${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $Image
${NSD_SetImage} $Image "C:\Users\User\Desktop\TrickyWays\test.png" $ImageHandle
${NSD_CreateLabel} 0 0 100% 40% "Hello, welcome to nsDialogs!"
Pop [=11=]
nsDialogs::Show
${NSD_FreeImage} $ImageHandle
FunctionEnd
您链接到的文档仅讨论与 MUI header 文本相关的自定义页面。函数中有一个 ... 您应该在其中放置实际的自定义页面代码。我将尝试修复文档的那部分内容。
自定义页面需要 plug-in,最受欢迎的可能是 nsDialogs。不调用 plug-in 的自定义页面将被自动跳过。
!include nsDialogs.nsh
!include mui2.nsh
Function myPageCreate
!insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
nsDialogs::Create 1018
Pop [=10=]
${If} [=10=] == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
Pop [=10=]
${NSD_CreateText} 0 13u 100% -13u "Type something here..."
Pop [=10=]
nsDialogs::Show
FunctionEnd
!insertmacro MUI_PAGE_WELCOME
Page custom myPageCreate
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
我想使用 nsis 创建自定义页面。只是文本,在不同的高度和可能的一些图像。类似于 oracle 所做的事情:
从 docs at "Custom Pages" 这是创建自定义页面的方式:
;--------------------------------
;Pages
Function CustomPageFunction
!insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
FunctionEnd
!insertmacro MUI_PAGE_WELCOME
Page custom CustomPageFunction
我正在寻找有关如何创建非常基本的自定义安装程序页面的其他指南,因为不幸的是,在 MUI_PAGE_WELCOME 之后没有显示带有 "TITLE" 和 "SUBTITLE" 的新页面,就像额外的一样需要添加说明。我错过了什么?ž
设置图像的更新:
var Image
var ImageHandle
Function CustomPageFunction
; !insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
nsDialogs::Create 1044
Pop [=11=]
${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $Image
${NSD_SetImage} $Image "C:\Users\User\Desktop\TrickyWays\test.png" $ImageHandle
${NSD_CreateLabel} 0 0 100% 40% "Hello, welcome to nsDialogs!"
Pop [=11=]
nsDialogs::Show
${NSD_FreeImage} $ImageHandle
FunctionEnd
您链接到的文档仅讨论与 MUI header 文本相关的自定义页面。函数中有一个 ... 您应该在其中放置实际的自定义页面代码。我将尝试修复文档的那部分内容。
自定义页面需要 plug-in,最受欢迎的可能是 nsDialogs。不调用 plug-in 的自定义页面将被自动跳过。
!include nsDialogs.nsh
!include mui2.nsh
Function myPageCreate
!insertmacro MUI_HEADER_TEXT "TITLE" "SUBTITLE"
nsDialogs::Create 1018
Pop [=10=]
${If} [=10=] == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
Pop [=10=]
${NSD_CreateText} 0 13u 100% -13u "Type something here..."
Pop [=10=]
nsDialogs::Show
FunctionEnd
!insertmacro MUI_PAGE_WELCOME
Page custom myPageCreate
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English