2010-08-13 4 views

답변

2

이것은 Inno Setup이 제공하는 범위를 벗어난 작업처럼 보입니다. 이 같은 파일을 자신의 호스트를 포함 할 수 있도록 http://www.jrsoftware.org/iskb.php?custom

+1

파스칼 스크립트 내장이 매우 가능으로

는 제안에 대한 기술 자료를 다음 문서를 참조하십시오 할 것. –

3

LMHOST은 #INCLUDE 문을 지원합니다 :

//call after inno setup step change 
procedure UpdateLMhosts(CurStep: TSetupStep); 
     var 

      contents: TStringList; 
      filename, statement: String; 
      i: Integer; 

     begin 
      if(CurStep=ssDone) then begin 
       filename := ExpandConstant('{sys}\drivers\etc\lmhosts'); 
       Log('Reading ' + filename); 
       contents := TStringList.Create(); 
       if(FileExists(filename)) then begin 
        contents.LoadFromFile(filename); 
       end; 

        //copy my lmhosts to the system's lmhosts 
       statement := ExpandConstant('#INCLUDE {commonappdata}\MyBrand\MyApp\lmhosts'); 
       if(contents.IndexOf(statement) < 0) then begin 
        Log('Adding' + statement); 
        contents.Append(statement); 
        contents.SaveToFile(filename); 
       end; 
      end; 
     end; 
+1

이것을 사용하는 사람에게'statement : ='를 호스트 파일에서 원하는 텍스트로 대체하십시오. –

관련 문제