WiX overwrites config files during setup. How can I avoid this?

前端 未结 5 820
傲寒
傲寒 2020-12-14 01:54

I\'m using WiX to create a windows installer. Unfortunately my installer overwrites a config file on every update. What I really want is, that the installer only creates th

5条回答
  •  攒了一身酷
    2020-12-14 02:40

    Component/@NeverOverwrite="yes" will do this. Just remember to set File/@KeyPath="yes" on one or more of the files so it can detect whether it is already present.

    If you're using heat.exe to harvest your file list automatically, you can use the following XSLT stylesheet to set this attribute on each Component containing a config file (and set each config File element as a key path).

    
    
      
    
      
        
          
        
      
    
      
        
          
            yes
          
          
        
      
    
      
        
          
            
              
            
          
        
      
    
    

    (Note: the XML namespace handling can probably be cleaned up, but it works.)

提交回复
热议问题