[wix-users] Installing Hyper-V from WiX

Davy Durham ddurham at davyandbeth.com
Fri Jun 19 15:50:52 PDT 2020


Can you provide any guidance on attempting to enable the Hyper-V feature 
from an installer?

I'm new to WiX, so I'm still learning.

My options are:
    - Hopeful that there is a standard or extensioned way to generically 
enable any of the available windows features and poof it's done

    - Execute a CustomAction which is a PowerShell script or run dism 
directly to enable it. 
(https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server)

     - Use a bootstrap to resolve dependencies first (this is totally 
foreign to me at the moment)

     - Detect if it's enabled and if not, just instruct the how to 
enable it.  Though, I'd prefer to do it for them


.NET 3.x is also something that must be optionally enabled.. so I 
figured there'd exist some standard way of enabling that feature (or 
features in general), but I didn't find much online.


Another hurdle is that enabling Hyper-V requires a reboot if it wasn't 
already enabled.  So, how best to resume the execute phase after the 
reboot?  Is this the right path: 
https://wixtoolset.org/documentation/manual/v3/xsd/wix/forcereboot.html

Also, I think I'm okay leaving Hyper-V enabled on uninstall (properly 
informing the user).. but I would clean up any VMs included in the 
installer.



TIA,
   Davy



More information about the wix-users mailing list