title: Windows API to query installed features and packages
body: <p>For one of my projects, I need a way to query which features/roles/role services are installed on a given Windows Server machine.</p>
  
  <p>In it's grand tradition, Microsoft keeps reinventing stuff (<code>sysocmgr</code> in Windows 2003, <code>pkgmgr</code> and <code>ocsetup</code> in Windows 2008, <code>dism</code> in Windows 2012), making it hard to write OS-independent code.</p>
  
  <p>I know for sure that there is an official native API for DISM (and a <a href="https://manageddism.codeplex.com/" rel="nofollow">managed wrapper</a>). Is there something for Windows 2003 and 2008?</p>