2014-04-10 2 views
2

나는 Inno를 며칠 동안 실험 해 왔기 때문에 지식 부족을 용서합니다! 사용자가 두 번째 옵션을 선택하면 Inno Setup - 라디오 버튼에 따라 파일을 건너 뛰는 방법

  • 만 시스템 파일 (DLL을 등)
  • 를 설치

    1. 설치 모든 : 내 설치 스크립트에서

      나는 두 가지 옵션이있는 TInputOptionWizardPage를 추가했습니다 , 특정 파일을 설치에서 제외하려면 어떻게해야합니까? 또한 아이콘이 생성되지 않도록 할 수 있습니까?

    답변

    2

    특정 파일의 조건부 설치를 위해 Check 함수를 작성할 수 있습니다. 이 함수에서는 라디오 버튼의 상태에 따라 파일을 설치할지 여부를 결정할 수 있습니다. 여기에 첫 번째 라디오 버튼은 사용자 옵션 페이지에서 선택한 경우 조건부 아이콘을 만드는 방법을 보여줍니다 예제 스크립트는 다음과 같습니다

    [Setup] 
    AppName=My Program 
    AppVersion=1.5 
    DefaultGroupName=My Program 
    DefaultDirName={pf}\My Program 
    
    [Icons] 
    Name: "{group}\My Program"; Filename: "calc.exe"; WorkingDir: "{app}"; Check: ShouldInstallIcon 
    
    [Code] 
    var 
        MyOptionsPage: TInputOptionWizardPage; 
    
    procedure InitializeWizard; 
    begin 
        MyOptionsPage := CreateInputOptionPage(wpWelcome, 'Caption', 'Description', 
        'SubCaption', True, False); 
        MyOptionsPage.Add('Install icon'); 
        MyOptionsPage.Add('Do not install icon'); 
        MyOptionsPage.Values[0] := True; 
    end; 
    
    function ShouldInstallIcon: Boolean; 
    begin 
        // here write a condition, which if you return True will process an entry; 
        // in this example the setup creates the icon if the first radio button is 
        // selected 
        Result := MyOptionsPage.Values[0]; 
    end; 
    
    +1

    이 있다는 것을 언급 할 가치가 내장 된 페이지가 만든 무엇을 관습 하나. '[Types]'섹션을 사용하여 설치 유형을 정의 할 수 있으며 선택된 유형을 지정한'[Components]'만 설치합니다. 사용법에 대해서는 ['Components.iss'] (https://github.com/jrsoftware/issrc/blob/is-5_5_4/Examples/Components.iss) 예제 스크립트를 참조 할 것입니다. – TLama

    관련 문제