NSIS安装完成页面定制
侧边栏壁纸
  • 累计撰写 17 篇文章
  • 累计收到 1 条评论

NSIS安装完成页面定制

nsisfans
2022-01-14 / 0 评论 / 16 阅读 / 正在检测是否收录...

在安装完成后,我们可能需要为用户提供可选的运行选项,如:运行XXX程序、打开Readme文件、访问XXX网站等。下面是MUI_FINISHPAGE支持的属性。

运行XXX程序

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT
!define MUI_FINISHPAGE_RUN_PARAMETERS
!define MUI_FINISHPAGE_RUN_NOTCHECKED ;默认不选中
!define MUI_FINISHPAGE_RUN_FUNCTION

; 自述文件
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION

访问XXX网站

!define MUI_FINISHPAGE_LINK
!define MUI_FINISHPAGE_LINK_LOCATION
!define MUI_FINISHPAGE_LINK_COLOR

示例:

; 引用MUI2.nsh头文件
!include "MUI2.nsh"

; 定义完成后要运行的程序
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "runSoft"
!define MUI_FINISHPAGE_RUN_TEXT "运行 $SoftName"

Function "runSoft"
    /* 
    运行的程序,可以多个
    如果只运行一个程序,可以这么写:
    !define MUI_FINISHPAGE_RUN "$INSTDIR\XXX.exe" 
    */
FunctionEnd

; 自述文件
!define MUI_FINISHPAGE_SHOWREADME "readme.txt"
; 默认不选中自述文件复选框
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED

; 访问XXX网站
!define MUI_FINISHPAGE_LINK "XXX"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.XXX.com"
; 文字颜色为红
!define MUI_FINISHPAGE_LINK_COLOR "FF0000"
0

评论 (0)

取消