WIX Installer - is there any automated way of managing Product ID / Code?

前端 未结 1 1837
南旧
南旧 2021-01-27 00:06

I\'m developing a Windows Service installer using Wix. From what I understand, I should generate a unique Product ID for every Version of the service. This can be easily done by

1条回答
  •  执笔经年
    2021-01-27 00:18

    Build Automation: You can use build automation in a number of ways to automate the creation of new product GUIDs and similar. You would pass in values to the WiX project file and such things, but perhaps that is not what you want to maintain. Let me add another option below.


    Major Upgrade Element: I assume you have a major upgrade element in there? It takes care of uninstalling the previous version if configured correctly. Typically you see multiple versions in Add / Remove Programs when you re-build the same version and install on top of the last installation.

    Suggestion: You can manually configure the Upgrade table to uninstall "same version installations". You take out the "auto-magic" of the "MajorUpgrade" element and do things yourself with Upgrade elements (an older way to configure the Upgrade table that yields more detailed control):

    Remove this (or just comment it out):

    
    

    Add this:

    
    
    
    
    
    <..>
    
    
      
      
    
    
    <..>
    
    
    
      
      
    
    

    Summary: The above should let you rebuild your setup and install any number of times using the same version number and the installation process will remove prior installation "auto-magically". Please test. No guarantees. Murphy's law. Etc... :-).


    Some Links:

    • Adding entries to MSI UpgradeTable to remove related products
    • Doing Major Upgrade in Wix creates 2 entries in Add/Remove Programs
    • WIX does not uninstall older version (list of common major upgrade problems)

    0 讨论(0)
提交回复
热议问题