2013-02-18 2 views

답변

4
는 ProjectInstaller 클래스

public override void Install(System.Collections.IDictionary stateSaver) 
     { 
       base.Install(stateSaver); 
       string lParam1 = Convert.ToString(GetParam("Param1")); 

     } 

     private object GetParam(string p) 
     { 
      try 
      { 
       if (this.Context != null) 
       { 
        if (this.Context.Parameters != null) 
        { 
         string lParamValue = this.Context.Parameters[p]; 
         if (lParamValue != null) 
          return lParamValue; 
        } 
       } 
      } 
      catch (Exception ex) 
      { 

      } 
      return string.Empty; 
     } 

의 설치 방법을 무시하고 사용하여 서비스를 설치

installutil /Param1=value path_to_your_exename