WIX enable Windows feature

后端 未结 3 796
小鲜肉
小鲜肉 2021-01-14 01:03

I have to check if some windows features are enabled beore installing my software.

I can check it or install it using dism command line tool.

I create a cust

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-14 01:38

    David Gardiner's answer hinted at the correct solution in my case. Creating your own custom action is not necessary. Here is how to do it for a 64 bit installation of Windows:

    First determine if MSMQ is installed:

    
      
    
    

    Declare your custom actions. You need two. One to set a property to the path to dism, and another to execute it:

    
    
    

    Finally specify the custom actions in the install sequence:

    
      
      NOT REMOVE AND NOT MSMQINSTALLED 
    
    

    Because this can take a little bit of time I've added the following to update the installer status text:

     
      Installing MSMQ 
     
    

    You can also specify a rollback action if you want to remove MSMQ on installation failure.

提交回复
热议问题