Failed to install and start Windows services in WiX installer

前端 未结 5 1814
一向
一向 2021-01-01 19:43

I am creating an MSI package for installing and starting Windows services using WiX v3.8. The code as follows:



        
5条回答
  •  时光取名叫无心
    2021-01-01 20:05

    So I got this error today because my service had dependencies that had to be GACed before starting the service. As it turns out, dependencies are GACed last by the installer, and there's really no good way to get around this without building some kind of bootstraper/multipart installer.

    However, I found the following resolution: deploy the assemblies both to the GAC and install them in the same directory as the service. This way, the service will be able to find the DLLs on start in the program files directory, and they will be GACed (which was a requirement for other reasons).

    To do this, I had to create two separate component groups, and a "dummy" Directory:

    
      
        
        
      
    
    

    I then create two Component Groups: one that has the exe and all libraries, and a second with the same libraries with the Assembly attribute set to ".net":

    
        
            
        
    
    
    
        
            
                          
        
        ... other components ...
    
    

    And now it works!

提交回复
热议问题