nsis离开自定义页面保存设置

这是群里一位朋友问他的自定义页面设置完成后返回上一步无法保存怎么办写的一个小例子,拓展了下,只要不关闭,不管上一步还是进入下一步返回都可以保留原页面设置

!include LogicLib.nsh
!include nsdialogs.nsh

XPStyle on
Page components
Page custom nsdialogspage
Page directory
OutFile "test.exe"
Name "test"
Section "test"
SectionEnd
Var
Initialpage
Var Text
Var Text2
Function nsdialogspage
nsDialogs::Create 1018
  
Pop $0
  ${If} $Initialpage
== ''
   
StrCpy $Text "默认值"
   
StrCpy $Initialpage "1"
  
${EndIf}
  ${NSD_CreateText}
0 0 80u 12u $Text
  
Pop $Text2
  ${NSD_OnChange} $Text2
OnChange
nsDialogs::Show
FunctionEnd

Function
OnChange
  
Pop $Text2
  ${NSD_GetText} $Text2 $Text
FunctionEnd


posted @ 2022-08-12 19:30  水晶石  阅读(96)  评论(0编辑  收藏  举报