Web application install with initial IIS settings; using WiX, need upgrade files, NOT changing IIS settings

后端 未结 1 1462
陌清茗
陌清茗 2021-01-30 12:00

I have a WiX install project that includes IIS setings for virtual directory and application settings with an application pool. After initial install, the customer will change t

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 12:39

    I apologize ahead of time for the long answer:

    I recommend keeping your Website and Content in two separate features and then giving them the option of supplying any variables needed for installation via UI or command line parameters. If you use the "Remember Property" pattern, then you can recall the variables used when changing or upgrading an installation (read all the way through the last comments, there is a slightly simpler way of doing it).

    This allows the person installing the product to set up everything with the given variables or set up the IIS website on their own and install only website content.

    This also jives well with MajorUpgrades. I don't currently see upgrade information in code you provided, so you should look into MajorUpgrades vs patches (major upgrades are much easier)

    
    

    Remember, variables accessed by $(var.name) are used at MSI compile time, whereas public variables accessed via brackets [MY_VARIABLE] are used at install time. Public variables can be exposed through the MSI UI, or provided to msiexec via command line (I use this for silent installs and/or specifying a log file)

    Here is a summary of the examples included below:

    • Configuration.wxi - This file implements the "remembered" properties
    • Product.wxs - Mostly like yours, but also includes MajorUpgrades, separate features for the website and content, and an inclusion of the UiFlow
    • IISConfiguration.wxs - A fragment containing the IIS Website, AppPool, and AppPool User using variables supplied at install time
    • UIFlow.wxs - Defining the flow of the UI to use, it's using the WixUI FeatureTree plugin, you may require something else for your UI
    • UIDialogs.wxs - This is where the variables used in installation are exposed to the UI

    Configuration.wxi:

    
    
    
        
        
            
        
        
            
        
        
            
        
        
            
        
        
        
    

    Product.wxs:

    
    
    
        
        
    
        
            
    
            
            
    
            
    
            
    
            
            
                
                    
    
                    
                
            
    
            
                
                
                
            
    
            
                
            
    
            
            
    
            
            
        
    
    

    IISConfiguration.wxs:

    
    
    
              
            
                
                    
                    
    
                    
                    
    
                    
                        
                    
    
                    
                        
                    
                
            
        
    
    

    UIFlow.wxs:

    
    
        
            
                
                
                
    
                
                
    
                LicenseAccepted = "1"
                1
            
        
    
    

    UIDialogs.wxs:

    
    
        
            
                                
                    
                    
                    
    
                    
                    
                        1
                    
    
                    
                        
                            
                             ""]]>
                        
                    
    
                    
                        1
                    
    
                    
                    
                        Please enter IIS Configuration
                    
    
                    
                    
                        {\WixUI_Font_Title}IIS Settings
                    
    
                    
                
    
                
                    
                    
                    
    
                    
                    
                    
    
                    
                    
                    
    
                    
                    
                    
    
                    
                    
                        1
                    
                    
                        
                            
                             "" 
                                     or WEB_APP_POOL_IDENTITY_DOMAIN <> "" 
                                     or WEB_APP_POOL_IDENTITY_USERNAME <> "" 
                                     or WEB_APP_POOL_IDENTITY_PWD <> ""]]>
                        
                    
    
                    
                        1
                    
    
                    
                    
                        Please enter AppPool Configuration for IIS
                    
    
                    
                    
                        {\WixUI_Font_Title}Application Pool Settings
                    
    
                    
                
            
        
    
    

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