如何在NSIS中调用函数内的目录页?

如何在NSIS中调用函数内的目录页?,nsis,Nsis,我已经使用NSIS脚本为我的应用程序创建了Exe文件。在我的脚本中,我检查了所选目录的可用空间 1.如果所选目录没有所需空间,则用户希望更改目录 2.更改目录页中的目录后,再次希望检查可用空间。因此,当所选目录有所需空间时,只需继续下一页。 所以它会在循环语句下出现 page custom checking Function checking Push "\" push $InstallDir Call SplitFirstStrPart pop $R0 ${DriveSpace} $R0 "/

我已经使用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
页面自定义检查
功能检查
按“\”
推送$InstallDir
调用SplitFirstStrPart
流行音乐$R0
${DriveSpace}$R0”/D=F/S=G“$R0

${While}$R0不能从函数调用页面,但可以通过调用页面预回调中的
Abort
跳过页面,也可以

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

!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