我的安装程序中出现空框? 我该如何删除它?

发布于 2024-07-24 06:59:30 字数 3324 浏览 7 评论 0原文

我正在为我的应用程序使用一个非常简单的安装脚本,它在部分选择屏幕上显示一个空框。 我想删除它,或者至少知道它的用途并将其填满。

这是一个屏幕截图 替代文本

和我的安装脚本

; example2.nsi
;
; This script is based on example1.nsi, but it remember the directory, 
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install ICV-MRI into a directory that the user selects,

;--------------------------------
!include "MUI.nsh"

; The name of the installer
Name "ICV-MRI"

; The file to write
OutFile "ICV-MRI_Setup.exe"

; The default installation directory
InstallDir $PROGRAMFILES\ICV-MRI

; Registry key to check for directory (so if you install again, it will 
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\ICV-MRI" "Install_Dir"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

Function LaunchLink
  ExecShell "" "$INSTDIR\mri.exe"
FunctionEnd

;--------------------------------

; Pages

Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;  !insertmacro MUI_PAGE_WELCOME
;  !insertmacro MUI_PAGE_DIRECTORY
;  !insertmacro MUI_PAGE_INSTFILES

    # These indented statements modify settings for MUI_PAGE_FINISH
    !define MUI_FINISHPAGE_NOAUTOCLOSE
    !define MUI_FINISHPAGE_RUN
    !define MUI_FINISHPAGE_RUN_NOTCHECKED
    !define MUI_FINISHPAGE_RUN_TEXT "Run MRI when the installer closes"
    !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
    !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
  !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"


;--------------------------------

; The stuff to install
Section "ICV-MRI (required)"

  SectionIn RO

  ; Set output path to the installation directory.
  SetOutPath $INSTDIR

  ; Put file there
  File "dist\bz2.pyd"
  File "dist\library.zip"
  File "dist\mri.exe"
  File "dist\PyQt4.QtCore.pyd"
  File "dist\PyQt4.QtGui.pyd"
  File "dist\python26.dll"
  File "dist\QtCore4.dll"
  File "dist\QtGui4.dll"
  File "dist\select.pyd"
  File "dist\sip.pyd"
  File "dist\unicodedata.pyd"
  File "dist\w9xpopen.exe"

  ; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\ICV-MRI "Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "DisplayName" "ICV-MRI"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "NoRepair" 1
  WriteUninstaller "uninstall.exe"

SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\ICV-MRI"
  CreateShortCut "$SMPROGRAMS\ICV-MRI\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\ICV-MRI\ICV-MRI.lnk" "$INSTDIR\mri.exe" "" "$INSTDIR\mri.exe" 0

SectionEnd

Section "Desktop Shortcuts"

  CreateShortCut "$DESKTOP\ICV-MRI.lnk" "$INSTDIR\mri.exe" "" "$INSTDIR\mri.exe" 0

SectionEnd

;--------------------------------

I'm using a pretty simple install script for my application and its showing an empty box on the section selection screen. I would like to remove it, or at least know what its for and fill it up.

here is a screenshot
alt text

and my install script

; example2.nsi
;
; This script is based on example1.nsi, but it remember the directory, 
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install ICV-MRI into a directory that the user selects,

;--------------------------------
!include "MUI.nsh"

; The name of the installer
Name "ICV-MRI"

; The file to write
OutFile "ICV-MRI_Setup.exe"

; The default installation directory
InstallDir $PROGRAMFILES\ICV-MRI

; Registry key to check for directory (so if you install again, it will 
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\ICV-MRI" "Install_Dir"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

Function LaunchLink
  ExecShell "" "$INSTDIR\mri.exe"
FunctionEnd

;--------------------------------

; Pages

Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;  !insertmacro MUI_PAGE_WELCOME
;  !insertmacro MUI_PAGE_DIRECTORY
;  !insertmacro MUI_PAGE_INSTFILES

    # These indented statements modify settings for MUI_PAGE_FINISH
    !define MUI_FINISHPAGE_NOAUTOCLOSE
    !define MUI_FINISHPAGE_RUN
    !define MUI_FINISHPAGE_RUN_NOTCHECKED
    !define MUI_FINISHPAGE_RUN_TEXT "Run MRI when the installer closes"
    !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
    !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
  !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"


;--------------------------------

; The stuff to install
Section "ICV-MRI (required)"

  SectionIn RO

  ; Set output path to the installation directory.
  SetOutPath $INSTDIR

  ; Put file there
  File "dist\bz2.pyd"
  File "dist\library.zip"
  File "dist\mri.exe"
  File "dist\PyQt4.QtCore.pyd"
  File "dist\PyQt4.QtGui.pyd"
  File "dist\python26.dll"
  File "dist\QtCore4.dll"
  File "dist\QtGui4.dll"
  File "dist\select.pyd"
  File "dist\sip.pyd"
  File "dist\unicodedata.pyd"
  File "dist\w9xpopen.exe"

  ; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\ICV-MRI "Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "DisplayName" "ICV-MRI"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ICV-MRI" "NoRepair" 1
  WriteUninstaller "uninstall.exe"

SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\ICV-MRI"
  CreateShortCut "$SMPROGRAMS\ICV-MRI\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\ICV-MRI\ICV-MRI.lnk" "$INSTDIR\mri.exe" "" "$INSTDIR\mri.exe" 0

SectionEnd

Section "Desktop Shortcuts"

  CreateShortCut "$DESKTOP\ICV-MRI.lnk" "$INSTDIR\mri.exe" "" "$INSTDIR\mri.exe" 0

SectionEnd

;--------------------------------

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尴尬癌患者 2024-07-31 06:59:30

如果您想删除它,请在脚本顶部!define MUI_COMPONENTSPAGE_NODESC

If you want to remove it, !define MUI_COMPONENTSPAGE_NODESC at the top of your script

就此别过 2024-07-31 06:59:30

该框用于部分描述。

查看 Modern UI Basic.nsi 文件:


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

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"
  
  ;ADD YOUR OWN FILES HERE...
  
  ;Store installation folder
  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
  
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

;--------------------------------
;Descriptions

  ;Language strings
  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."

  ;Assign language strings to sections
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
  !insertmacro MUI_FUNCTION_DESCRIPTION_END

阅读更多内容 Modern UI 自述文件< /a>,组件页面描述部分。

现代 UI 组件页面有一个文本框,当用户将鼠标悬停在组件上时可以在其中显示说明。 如果您不想使用这些描述,请插入 MUI_COMPONENTSPAGE_NODESC 界面设置。

要设置节的描述,需要将附加参数添加到节命令中,并带有该节的唯一标识符。 此名称稍后可用于设置此部分的描述。

That box is for the section description.

Take a look at the Modern UI Basic.nsi file:


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

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"
  
  ;ADD YOUR OWN FILES HERE...
  
  ;Store installation folder
  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
  
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

;--------------------------------
;Descriptions

  ;Language strings
  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."

  ;Assign language strings to sections
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
  !insertmacro MUI_FUNCTION_DESCRIPTION_END

Read more Modern UI Readme, section on Components page descriptions.

The Modern UI components page has a text box in which a description can be shown when the user hovers the mouse over a component. If you don't want to use these descriptions, insert the MUI_COMPONENTSPAGE_NODESC interface setting.

To set a description for a section, an additional parameter needs to be added to Section commmand with a unique identifier for the section. This name can later be used to set the description for this section.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文