Registering an Executable File (exe) as a Control Panel Applet on Windows Vista using Windows Installer XML (WIX)

In Windows Vista, we have expanded the way that we implement Control Panel applets. In the past, you would package these as *.cpl files (and you still can). With Windows Vista, you can also create a control panel applet as an executable file (or by invoking your main executable with command line arguments), and then register that applet.

This can come in handy, as there are well published guidelines for specifying elevation level for an executable file with a manifest, but no such guidance for .cpl files. This makes sense, because .cpl files are really just .dll files that have been renamed. Since you don't elevate in process, this becomes more of a challenge. It's easier to just point to a manifested .exe, and this is what we recommend for developers targeting Windows Vista.

We provide guidelines on registering control panel applets here:

I was playing around with this for the purpose of some demos, and rather than setting these registry entries manually, I opted to just create an installer that would set the appropriate registry entries. I figured I would take the .wxs file I created for WIX, trim out the bits from the rest of my installer, and share this. Developing as an .exe and then just registering it should simplify the development process, because now your control panel application behaves the same way as the rest of your desktop applications.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="">
  <Product Id="{guid#1}" Name="CplApp" Language="1033" Version="" Manufacturer="Your Company">
    <Package Id="{guid#2}" Description="CplApp" Manufacturer="Your Company" InstallerVersion="200" Compressed="yes" />
    <Media Id='1' Cabinet='' EmbedCab='yes' VolumeLabel='CplApp'/>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLLOCATION" Name="CplApp" >
          <Component Id="CplApp" Guid="{guid#3}">
            <File Id="CplAppExe" Assembly="no" Name="CplApp.exe" Source="pathCplApp.exe" DiskId="1" />
            <File Id="CplAppIco" Assembly="no" Name="CplApp.ico" Source="pathCplApp.ico" DiskId="1" />
            <Registry Id="CplNamespaceKey" Root="HKLM" Key="SoftwareMicrosoftWindowsCurrentVersionExplorerControlPanelNamespace{guid#4}" Action="createKeyAndRemoveKeyOnUninstall" >
              <Registry Id="CplNamespaceValue" Value="CplApp" Type="string" Action="write" />
            <Registry Id="CplClassIdKey" Root="HKCR" Key="CLSID{guid#4}" Action="createKeyAndRemoveKeyOnUninstall" >
              <Registry Id="CplClassIdValue" Value="CplApp" Action="write" Type="string" />
              <Registry Id="CplAppNameValue" Name="System.ApplicationName" Value="YourCompany.CplApp" Action="write" Type="string" />
              <Registry Id="CplAppCategoryValue" Name="System.ControlPanel.Category" Value="1,8" Type="string" Action="write" />
              <Registry Id="CplLocalizedStringValue" Name="LocalizedString" Value="CplApp" Type="expandable" Action="write" />
              <Registry Id="CplInfoTipValue" Name="InfoTip" Value="Runs Your Control Panel Applet" Type="expandable" Action="write" />
              <Registry Id="CplDefaultIconKey" Key="DefaultIcon" Action="createKeyAndRemoveKeyOnUninstall" >
                <Registry Id="CplDefaultIconValue" Value="%ProgramFiles%CplAppCplApp.ico" Type="expandable" Action="write" />
              <Registry Id="CplShellKey" Key="ShellOpenCommand" Action="createKeyAndRemoveKeyOnUninstall" >
                <Registry Id="CplShellValue" Value="%ProgramFiles%CplAppCplApp.exe" Type="expandable" Action="write" />
    <Feature Id="ControlPanelAll" Title="All Control Panel Application Files" Level="1">
      <ComponentRef Id="CplApp" />

Comments (0)

Skip to main content