WiX, how to prevent files from uninstalling though we forgot to set Permanent=“yes”

前端 未结 2 1428
-上瘾入骨i
-上瘾入骨i 2021-02-15 11:42

We have a product installer created with Wix, containing a program package (\"V1\") and some configuration files. Now, we are going to make a major upgrade with

2条回答
  •  星月不相逢
    2021-02-15 12:09

    Try the NeverOverwrite attribute for the configuration file

    If this attribute is set to 'yes', the installer does not install or reinstall the component if a key path file or a key path registry entry for the component already exists.

    EDIT

    I have just tested this in a test setup. At first it didn't work because I had scheduled the RemoveExistingProducts action before InstallInitialize sequence. This removes the old product before the new product is installed so it can't compare.

    However when I set it to after InstallFinalize it did work, it left the file there even though the original setup didn't have NeverOverwrite set. here are my two test examples

    version 1.0.0.0

    
    
        
            
            
            
                
                
            
            
                
                    
                        
                            
                        
                    
                
            
            
            
            
                NEWERFOUND
                
            
            
            
            
        
    
    

    version 1.0.1.0

    
    
        
            
            
            
                
                
            
            
                
                    
                        
                            
                        
                    
                
            
            
            
            
                
    NEWERFOUND
                
            
            
            
            
        
    
    

提交回复
热议问题