NSIS 检查文本框为空不起作用
我试图在 NSIS 中显示一个页面以获得两个不同的值。我希望两者都不为空。该页面实际上显示,但我无法让我的页面离开功能正确检查空字段。
Function CCInstallOpts
ReserveFile "cc_installopt.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "cc_installopt.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "cc_installopt.ini"
FunctionEnd
我验证字段( 4 和 5 )的页面离开功能是:
Function CCInstallOptsLeave
Push $R0
Push $R1
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "cc_installopt.ini" "Field4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "cc_installopt.ini" "Field5" "State"
StrCmp $R0 "" mustcomplete
StrCmp $R1 "" mustcomplete
StrCpy $CC_CyberID $R0
StrCpy $CC_VCode $R1
goto exitfunc
mustcomplete:
MessageBox MB_OK|MB_ICONEXCLAMATION "Empty not allowed"
Abort
exitfunc:
Pop $R1
Pop $R0
FunctionEnd
请注意,我想将输入的值存储到 $CC_VCode 和 $CC_CyberID 变量中,以便稍后在不同的文件上使用(我将两者定义为:)
Var /GLOBAL CC_VCode
Var /GLOBAL CC_CyberID
提前致谢。
I'm trying to display a page in NSIS to obtain two different values. I want both to be not empty. The page actually displays altough I can't get my page leave function to check properly for empty fields.
Function CCInstallOpts
ReserveFile "cc_installopt.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "cc_installopt.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "cc_installopt.ini"
FunctionEnd
My page leave function where I validate fields (4 and 5 ) is :
Function CCInstallOptsLeave
Push $R0
Push $R1
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "cc_installopt.ini" "Field4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "cc_installopt.ini" "Field5" "State"
StrCmp $R0 "" mustcomplete
StrCmp $R1 "" mustcomplete
StrCpy $CC_CyberID $R0
StrCpy $CC_VCode $R1
goto exitfunc
mustcomplete:
MessageBox MB_OK|MB_ICONEXCLAMATION "Empty not allowed"
Abort
exitfunc:
Pop $R1
Pop $R0
FunctionEnd
Note that I want to store the entered values into $CC_VCode and $CC_CyberID variables to be later used on different files (I've defined both as:)
Var /GLOBAL CC_VCode
Var /GLOBAL CC_CyberID
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在字段名称中缺少空格
You are missing a space in the field name