简体   繁体   English

NSIS安装程序nsDialog复选框未出现,因为我认为它应该出现

[英]NSIS installer nsDialog checkbox not appearing as I think it should

I'm adding a custom page to an NSIS installer and I'm having trouble adding a checkbox. 我正在向NSIS安装程序添加自定义页面,但无法添加复选框。 All the examples I've seen look the same, which is what I'm doing, but I can't see what could be wrong. 我所看到的所有示例看起来都一样,这就是我正在做的事情,但是我看不出有什么问题。 (I've only been using NSIS for an hour or so!). (我只使用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

When the page appears the check box isn't there: 页面出现时,复选框不存在:

nsis nsdialog复选框问题

My issue was rather silly. 我的问题很傻。 The Label was simply above the check box, rendering it invisible. 标签仅在复选框上方,使其不可见。 My mistake. 我的错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM