删除“正在安装”来自 NSIS 安装程序窗口标题

发布于 2024-12-12 08:41:29 字数 1430 浏览 0 评论 0原文

我有一个 NSIS 安装程序脚本,用于部署 py2exe 构建的应用程序(使用 NSIS 2.46)。我唯一无法解决的用户界面细节是安装程序上的窗口标题。

根据文档, Caption 指令应该设置这个文本。但无论我设置什么,它总是附加文本“:安装”。也就是说,如果我有:

Caption "My Special App"

...那么安装程序上的窗口标题将显示“我的特殊应用程序:正在安装”。我该如何解决这个问题?

(我想避免这种情况,因为我实际上使用 NSIS 安装程序将应用程序提取到临时目录并运行一次,而不是永久安装它。)

我的整个 NSI 文件是:

!define py2exeOutputDirectory 'C:\Path\To\P2EOutput'
!define exe 'MyApp.exe'

; Comment out the "SetCompress Off" line and uncomment
; the next line to enable compression. Startup times
; will be a little slower but the executable will be
; quite a bit smaller
;SetCompress Off
SetCompressor /SOLID lzma

Caption "My Special App"

Name 'MyApp'
OutFile ${exe}
Icon 'C:\Path\To\Icon\icon.ico'

;SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow

Section
    DetailPrint "Extracting program..."
    SetDetailsPrint none

    InitPluginsDir
    SetOutPath '$PLUGINSDIR'
    File /r '${py2exeOutputDirectory}\*'

    GetTempFileName $0
    ;DetailPrint $0
    Delete $0
    StrCpy $0 '$0.bat'
    FileOpen $1 $0 'w'
    FileWrite $1 '@echo off$\r$\n'
    StrCpy $2 $TEMP 2
    FileWrite $1 '$2$\r$\n'
    FileWrite $1 'cd $PLUGINSDIR$\r$\n'
    FileWrite $1 '${exe}$\r$\n'
    FileClose $1
    HideWindow
    nsExec::Exec $0
    Delete $0
SectionEnd

I have an NSIS installer script that I'm using to deploy a py2exe-built app (using NSIS 2.46). The only UI detail I can't iron out is the window title on the installer.

According to the docs, the Caption directive should set this text. But whatever I set, it always has the text ": Installing" appended to it. That is, if I have:

Caption "My Special App"

...then the window title on the installer shows "My Special App: Installing". How do I get around this?

(I want to avoid this because I'm actually using the NSIS installer to extract the app to a temporary directory and run it once, not to permanently install it.)

My entire NSI file is:

!define py2exeOutputDirectory 'C:\Path\To\P2EOutput'
!define exe 'MyApp.exe'

; Comment out the "SetCompress Off" line and uncomment
; the next line to enable compression. Startup times
; will be a little slower but the executable will be
; quite a bit smaller
;SetCompress Off
SetCompressor /SOLID lzma

Caption "My Special App"

Name 'MyApp'
OutFile ${exe}
Icon 'C:\Path\To\Icon\icon.ico'

;SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow

Section
    DetailPrint "Extracting program..."
    SetDetailsPrint none

    InitPluginsDir
    SetOutPath '$PLUGINSDIR'
    File /r '${py2exeOutputDirectory}\*'

    GetTempFileName $0
    ;DetailPrint $0
    Delete $0
    StrCpy $0 '$0.bat'
    FileOpen $1 $0 'w'
    FileWrite $1 '@echo off$\r$\n'
    StrCpy $2 $TEMP 2
    FileWrite $1 '$2$\r$\n'
    FileWrite $1 'cd $PLUGINSDIR$\r$\n'
    FileWrite $1 '${exe}$\r$\n'
    FileClose $1
    HideWindow
    nsExec::Exec $0
    Delete $0
SectionEnd

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

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

发布评论

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

评论(1

半步萧音过轻尘 2024-12-19 08:41:29
SubCaption 3 " "

PageEx InstFiles
        Caption " "
PageExEnd

LangString "^InstallingSubCaption" 0 " "
SubCaption 3 " "

or

PageEx InstFiles
        Caption " "
PageExEnd

or

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