2014-04-23 3 views
0

설치 프로그램에서 1 페이지 앞으로 건너 뛰고 있습니다. 내 NSIS 설치 프로그램에 사용자 지정 페이지가 있습니다. 이 사용자 정의 페이지는 사용자에게 일련 번호를 입력하라는 메시지를 표시합니다. 유효하다면 우리는 페이지에 남아 있지 않으면 설치 프로그램을 다음 페이지 (시작 페이지)로 건너 뛸 것입니다. Initialize 및 Finalize 함수 내에서 다음 페이지로 점프 할 것입니다.다음 페이지로 이동

다음 페이지로 건너 뛸 때마다 설치 프로그램이 닫힙니다. AbortReturn을 시도했지만 둘 다 설치 프로그램을 닫습니다. 나는 또한 Call RelGoToPage을 trid했는데, $R9이 이지만 사용자가 이미 가지고있는 페이지, 즉 무한 루프를 다시 보냅니다.

잘못된 점이 무엇이며 어떻게 설치 프로그램을 다음 페이지로 이동할 수 있습니까? 나를 위해

# Page Definition 
Page Custom SerialPageInitialise SerialPageFinalise 

# Page Implementation 
Function SerialPageInitialise 
    !insertmacro ValidateSUser 
    ${If} $isValidUser > 0 # If user if valid 
     Return # Go to next page...Doesn't work just closes the whole installer 
     #Abort # Doesn't work just closes the whole installer 
    ${EndIf} 
FunctionEnd 

# For the following function: the message "A" always shows then the installer closes 
Function SerialPageFinalise 
    ${NSD_GetText} $SerialEditBx $R9 
    !insertmacro ValidateUserExpanded "$R9" 
    ${If} $isValidUser > 0 # If user if valid 
     MessageBox MB_OK "A" 
    ${Else} 
     MessageBox MB_OK|MB_ICONEXCLAMATION "Authentication Failed. You are not a recognised client." 
     Abort 
    ${EndIf} 
FunctionEnd 
+0

당신의 예를 들어 한 페이지 만, 어디 점프하도록되어있다? – Anders

답변

0

작품 미세 :

!include LogicLib.nsh 
!include nsDialogs.nsh 

var isValidUser 
var SerialEditBx 
!macro ValidateUserExpanded param 
StrCpy $isValidUser 0 
${If} ${param} = 666 
    StrCpy $isValidUser 1 
${EndIf} 
!macroend 

!macro ValidateSUser 
MessageBox mb_yesno "ValidateSUser?" IDNO nope 
!insertmacro ValidateUserExpanded 666 
nope: 
!macroend 

Function SerialPageInitialise 
!insertmacro ValidateSUser 
${If} $isValidUser > 0 
    Abort ; Skip page 
${EndIf} 
nsDialogs::Create 1018 
Pop $0 
${NSD_CreateText} 0 13u 50% 13u "667" 
Pop $SerialEditBx 
nsDialogs::Show 
FunctionEnd 

Function SerialPageFinalise 
${NSD_GetText} $SerialEditBx $R9 
!insertmacro ValidateUserExpanded "$R9" 
${If} $isValidUser > 0 # If user if valid 
    MessageBox MB_OK "OK" 
${Else} 
    MessageBox MB_OK|MB_ICONEXCLAMATION "Authentication Failed. You are not a recognised client." 
    Abort ; Don't allow going to next page 
${EndIf} 
FunctionEnd 

Page Custom SerialPageInitialise SerialPageFinalise 
Page InstFiles