title: How to enable windows features using wix installer
body: <p>I am using windows 10 64bit operating system. IT have .net framework 3.5 pre installed and we need to just enable it for .net dependent applications to work</p>
  <p>My requirement is to create a new MSI which first enables .net 3.5 and later install my application.</p>
  <p>First I tried to create bundle but bundle is creating only EXE and its not having permission to install the .net framework. Later I added custom action in Product.wsx to run &quot;NetFx20SP2_x64.exe&quot; which worked. But I am not sure whether its right way to do or not.</p>
  <p>IS there any way to enable .NEt framework 3.5 using wix installer(3.11) without calling executables or create bundle.</p>
  <pre><code>Bundle.wsx (code snippet)
      &lt;PackageGroup Id=&quot;Netfx4Full&quot;&gt;
        &lt;ExePackage Id=&quot;Netfx4Full&quot; 
                    Cache=&quot;yes&quot; 
                    Compressed=&quot;yes&quot; 
                    PerMachine=&quot;yes&quot; 
                    Permanent=&quot;yes&quot; 
                    Vital=&quot;yes&quot;
                    InstallCondition=&quot;VersionNT64&quot;
                    InstallCommand=&quot;/s&quot;
                    UninstallCommand=&quot;/s /uninstall&quot;
                    SourceFile=&quot;.\NetFx20SP2_x64.exe&quot;
                    DetectCondition=&quot;Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)&quot;  /&gt;
      &lt;/PackageGroup&gt;
  
  Custom action in Product.wsx
      &lt;!--CustomAction Id=&quot;RegisterEXE&quot;
                    Directory=&quot;APPLICATIONROOTDIRECTORY&quot;
                    ExeCommand=&quot;&amp;quot;[APPLICATIONROOTDIRECTORY]Upgrade\NetFx20SP2_x64.exe&amp;quot; /Register&quot;
                    Execute=&quot;deferred&quot;
                    Return=&quot;ignore&quot;  
                    Impersonate=&quot;no&quot;
                   /--&gt;
  </code></pre>