2013-10-05 2 views
0

NSIS를 사용하여 일부 기본 페이지 및 일부 사용자 정의 페이지를 포함하는 설치 프로그램을 만들고 있습니다. 설치 중에 명령 줄이 전달 된 경우에만 설치를 사용하여 사용자 정의 페이지를 표시하려고합니다. 어떻게합니까? 할 수 있니? 위의 예에서명령 줄 옵션 및 건너 뛰기 페이지

!include "MUI.nsh" 
!include nsDialogs.nsh 

OutFile "myCustomPage.exe" 
var installmethod 
Page Custom MyCustomPage 
Page Custom MyCustomPage1 
Page Custom MyCustomPage3 

Function MyCustomPage 
nsDialogs::Create 1044 

    nsDialogs::Show 

FunctionEnd 
Function MyCustomPage1 
nsDialogs::Create 1044 

    nsDialogs::Show 

FunctionEnd 
Function MyCustomPage3 
nsDialogs::Create 1044 

    nsDialogs::Show 
FunctionEnd 
Section Dummy 
SectionEnd 

예 3 난 pages.I 정상 설치 중에 두 페이지와 MyCustomPage MyCustomPage3를 도시 할 수 있습니다. 명령 줄 (특정 명령 줄)이 전달되면 installation.how에서 3 페이지가 모두 표시됩니다.

답변

1
!include FileFunc.nsh 
!include LogicLib.nsh 

Page Custom MyPageCreate 

Function MyPageCreate 
${GetParameters} $0 
ClearErrors 
${GetOptions} "$0" "/ShowSpecial" $1 
${If} ${Errors} 
    Abort ; Skip page 
${EndIf} 
nsDialogs::Create 1044 
nsDialogs::Show 
FunctionEnd 
+0

당신이하고있는 일에 대한 몇 가지 설명이 도움이 될 것입니다. – cHao

+0

안녕하세요 Andres. 아래 내 대답을 확인하십시오. 당신은 getoption 등을 사용했습니다. 제 방법에 문제가 있습니까? 제대로 작동합니다. 하지만 제 방법은 효율적이고 적절한 방법입니까? –

+0

다른 매개 변수를 지원하지 않고 따옴표를 신경 쓰지 않는다면 버전은 정상입니다 ... – Anders

0

아래 코드는 명령 줄 옵션이 "a"인 경우 MyCustomPage1 페이지를 건너 뜁니다.

!include "MUI.nsh" 
!include "FileFunc.nsh" 
!include nsDialogs.nsh 
!insertmacro GetParameters 

OutFile "myCustomPage.exe" 
var installmethod 
Page Custom MyCustomPage 
Page Custom MyCustomPage1 
Page Custom MyCustomPage3 

Function MyCustomPage 
    nsDialogs::Create 1044 
    nsDialogs::Show 
FunctionEnd 

Function MyCustomPage1 
    ${GetParameters} $R0 
    ${If} $R0 == 'a' 
     abort 
    ${EndIf} 
    nsDialogs::Create 1044 
    nsDialogs::Show 
FunctionEnd 

Function MyCustomPage3 
    nsDialogs::Create 1044 
    nsDialogs::Show 
FunctionEnd 

Section Dummy 
SectionEnd