【问题标题】:How to call directory page inside the function in NSIS?如何在 NSIS 函数内调用目录页面?
【发布时间】:2013-08-30 00:17:26
【问题描述】:

我使用 NSIS 脚本为我的应用程序创建了 Exe 文件。在我的脚本中,我检查了所选目录的可用空间。

1.如果所选目录没有所需空间,则用户想要更改目录。

2.在目录页面中再次更改目录后要检查可用空间。因此,当所选目录所需的空间可用时,请仅继续下一页。 所以它会在循环语句下。我试过下面的脚本

page custom checking
Function checking
Push "\"
push $InstallDir
Call SplitFirstStrPart
pop $R0
${DriveSpace} $R0 "/D=F /S=G" $R0
${While} $R0 <= 2
    MessageBox MB_OK "Expected free space is not availble"
    call directory
${EndWhile}
Function directory

--Here i want to define directory page--
[page directory] we cant use this here
call checking
FunctionEnd

1.如何创建用户自定义目录页面?

2.是否可以多次调用页面目录或MUI_PAGE_DIRECTORY?

谢谢

【问题讨论】:

    标签: nsis


    【解决方案1】:

    您不能从函数中调用页面,但您可以通过在页面 PRE 回调中调用 Abort 来跳过页面,也可以通过 jump to any page 来跳过页面。

    您可以拥有所有页面类型的多个页面:

    !include MUI.nsh
    Var dir1
    Var dir2
    Function .onInit
    StrCpy $dir1 c:\default1
    StrCpy $dir2 c:\default2
    FunctionEnd
    !define MUI_DIRECTORYPAGE_VARIABLE $dir1
    !insertmacro MUI_PAGE_DIRECTORY
    !define MUI_DIRECTORYPAGE_VARIABLE $dir2
    !insertmacro MUI_PAGE_DIRECTORY
    !insertmacro MUI_PAGE_INSTFILES
    !insertmacro MUI_LANGUAGE English
    Section
    DetailPrint $dir1
    DetailPrint $dir2
    SectionEnd
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多