【问题标题】:NSIS installer nsDialog checkbox not appearing as I think it shouldNSIS 安装程序 nsDialog 复选框没有像我认为的那样出现
【发布时间】:2016-07-17 19:49:33
【问题描述】:

我正在向 NSIS 安装程序添加自定义页面,但在添加复选框时遇到问题。我见过的所有例子看起来都一样,这就是我正在做的事情,但我看不出有什么问题。 (我只使用 NSIS 一个小时左右!)。

!include MUI2.nsh
!include WordFunc.nsh
!insertmacro VersionCompare
!include LogicLib.nsh
!include InstallOptions.nsh
!include nsDialogs.nsh

Name "xxxxx"
;!define MUI_ICON "bcs.ico"
;!define MUI_HEADERIMAGE
;!define MUI_HEADERIMAGE_BITMAP "bcs.bmp"
;!define MUI_WELCOMEFINISHPAGE_BITMAP "bcs164.bmp"
;!define MUI_HEADERIMAGE_RIGHT

OutFile "nqcs_setup.exe"
InstallDir "$PROGRAMFILES\xxxx"
InstallDirRegKey HKLM "Software\xxxx" "InstallDir"
RequestExecutionLevel admin

Var Dialog
Var Heading
Var ServiceQuestion
Var SvcCheckBox

Function installOptionsPage

    nsDialogs::Create 1018
    Pop $Dialog

    ${If} $Dialog == error
        Abort
    ${EndIf}

    ${NSD_CreateLabel} 0 0 100% 50 "Installation Options"
    Pop $Heading
    CreateFont $0 "$(^Font)" "14" "500"
    SendMessage $Heading ${WM_SETFONT} $0 1

    ${NSD_CreateLabel} 0 50 100% 20 "Would you like to install as a service?"
    Pop $ServiceQuestion
    CreateFont $0 "$(^Font)" 11
    SendMessage $ServiceQuestion ${WM_SETFONT} $0 1

    ${NSD_CreateCheckbox} 50 50 100% 15 "Checkbox Test"
    Pop $SvcCheckBox
    ;GetFunctionAddress $0 OnCheckbox
    nsDialogs::OnClick $SvcCheckBox $0

    nsDialogs::Show

FunctionEnd

当页面出现时,复选框不存在:

【问题讨论】:

    标签: checkbox installation nsis custom-pages nsdialogs


    【解决方案1】:

    我的问题相当愚蠢。标签就在复选框的上方,使其不可见。我的错。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-19
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多