wix HeatDirectory ServiceInstall

前端 未结 2 719
挽巷
挽巷 2020-12-16 15:13

I\'m using HeatDirectory to create source .wxs file. In the pickup directory there is an exe which should be installed as service. Actually I know how to install service if

2条回答
  •  情书的邮戳
    2020-12-16 15:59

    I assume that you already know the name of your file that needs to be wrapped in a ServiceInstall element.

    This can be achieved using xsl transformation. The process can be automated using the XslTransformation MSBuild task. Here is what I have done recently:

    In the wixproj file in the BeforeBuild target add some parameters to pass on to the xsl, if you like you can hard code these in your xsl and skip this step:

    
      
        
        
        
        
        
      
      ...
    
    

    Then after your HeatDirectory task call the XslTransformation task like this:

    
    

    Add the WixService.xsl transformation file to your project. The file is as below:

    
      
    
      
      
      
      
    
      
        
          
        
      
    
      
      
        
          
        
      
    
      
          
            
              
          
            
          
          
            
          
    
          
            
              
            
            
              
            
            yes
          
    
          
            
            SERVICEINSTALLER
            
              
            
            
              
            
            
              
            
            auto
            ownProcess
            [USERNAME]
            [PASSWORD]
            normal
            yes
            
            
              DEPENDENCY
            
            
            
              restart
              restart
              none
              60
            
    
          
          
          
            SERVICECONTROLLER
            
              
            
            uninstall
            uninstall
            no
          
    
               
      
    
    
    

    once done wish for a better way of doing this...

提交回复
热议问题