【问题标题】:Remove button pane at the bottom in NSIS installer删除 NSIS 安装程序底部的按钮窗格
【发布时间】:2020-09-24 12:22:39
【问题描述】:

我正在使用 NSIS 创建一个只有自定义页面的安装程序。 自定义页面不应该有默认按钮(返回、下一步或取消),但页面中心只有 1 个按钮。 有什么方法可以删除整个底部窗格,正如我在附加图片中突出显示的那样? 我已经隐藏了按钮,但我想删除分隔线及其下方的部分。

这是我的代码:

;--------------------------------
;Include Modern UI
  !include "MUI2.nsh"

;--------------------------------
;General

  ;Name and file
  Name "Custom Test"
  OutFile "custom_installer.exe"

  ;Default installation folder
  InstallDir "$LOCALAPPDATA\Custom Test"

  ;Remove default branding text of Nullsoft
  BrandingText " "

;--------------------------------
;Interface Settings
  !define MUI_LICENSEPAGE_BGCOLOR "814EFA"
  !define MUI_ABORTWARNING
  !define MUI_BGCOLOR "000000"

;--------------------------------
;Functions
Function Start
  nsDialogs::Create 1044
  Pop $0
    SetCtlColors $0 222425 FBFBFB
  
  ${NSD_CreateButton} 20 170 90% 15u INSTALL

  GetDlgItem $0 $HWNDPARENT 3 ; Back Button
  GetDlgItem $1 $HWNDPARENT 1 ; Next/Close Button
  GetDlgItem $2 $HWNDPARENT 2 ; Cancel Button
  
  ShowWindow $0 ${SW_HIDE}
  ShowWindow $1 ${SW_HIDE}
  ShowWindow $2 ${SW_HIDE}

    nsDialogs::Show
FunctionEnd

;--------------------------------
;Pages

  Page custom Start
  !insertmacro MUI_PAGE_COMPONENTS

;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"

SectionEnd

这就是安装程序页面现在的样子:

【问题讨论】:

  • 您要仅在此页面上删除它还是在所有页面上删除它?
  • 所有页面。安装程序将只有 3 个自定义页面,我想在所有这些页面上删除底部窗格。

标签: nsis


【解决方案1】:

如何使用 SetBrandingText " " 隐藏水平线并使用 SetCtlColors $0 222425 FBFBFB 为底部区域着色,使其看起来像对话框的其余部分?

您是否可以接受,或者您想让对话框更小(降低其高度)?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-30
    • 1970-01-01
    • 2012-08-20
    相关资源
    最近更新 更多