Registering Control Panels (and other simple tasks) in WINNT True Integrator Addons
Here's a short guide showing how to do simple WINNT True Integrator addons using just an entries.ini file for simple file copy and registry entries, using examples of registering Control Panels. Same principles apply here if you're just doing plain file copies (say, in lieu of setting up $OEM% folders), applying reg tweaks, or other assorted simple functions supported by the Integrator's subset INF functionality in its entries.ini's. The guide also shows you how to handle dual x86 + x64 CPL registration addons and get them working on both platforms.
Note that these are not uninstallable in the Integrator because they are just entries.ini addons.
----------------------------------------------------------------------------------------------------
Example #1: Simple CPL Registration for internal Windows programCode: Select all
[general]
title = Registry Editor CPL
description = Adds Registry Editor to Control Panel
builddate = 06/23/2011
releasetype = True Addon
[TweaksAddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"",,0x0,"%CPL_Name%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","InfoTip",0x0,"%CPL_Tip%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","System.ControlPanel.Category",0x0,"%CPL_Category%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\DefaultIcon",,0x0,"%CPL_Icon%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%"",,0x0,"%CPL_Name%"
[Strings]
CPL_Name = "Registry Editor"
CPL_Tip = "Add and edit registry keys and values, restore the registry from a backup or to default values, and import or export keys for reference or backup."
CPL_Category = 5
CPL_CmdLine = "%SystemRoot%\regedit.exe"
CPL_Icon = "%SystemRoot%\regedit.exe,-100"
CPL_CLSID = {2d805cd4-85e6-44ad-bb3c-4711941d0ec8}
The reg entries shown are universal for registering CPL's, so you can just change the strings. If doing just a misc collection of reg tweaks, the Integrator can also call a "[TweaksDelReg]" section usable for deleting reg entries similar to the INF DelReg directive.
----------------------------------------------------------------------------------------------------
Example #2a: CPL registration with file copyCode: Select all
[general]
title = DirectX Properties Control Panel
description = Control Panel for changing properties for DirectX.
version = 9.29.1962.0
company = Microsoft Corporation
builddate = 06/23/2011
releasetype = True Addon
[GlobalOffLineChanges.Install]
CopyFiles = DirectXCPL.Files
[SourceDisksNames]
1 = "DirectX CPL",,,
[SourceDisksFiles]
dxcpl.exe=1
[DestinationDirs]
DirectXCPL.Files = 11
[DirectXCPL.Files]
dxcpl.exe
[TweaksAddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"",,0x0,"%CPL_Name%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","InfoTip",0x0,"%CPL_Tip%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","System.ControlPanel.Category",0x0,"%CPL_Category%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\DefaultIcon",,0x0,"%CPL_Icon%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%"",,0x0,"%CPL_Name%"
[Strings]
CPL_Name = "DirectX Properties"
CPL_Tip = "Changes properties for DirectX."
CPL_CmdLine = "%SystemRoot%\System32\dxcpl.exe"
CPL_Icon = "%SystemRoot%\System32\dxcpl.exe"
CPL_Category = "2"
CPL_CLSID = {262dcacb-cd4b-4ee0-88fb-792ffa1af36e}
Same as Example #1, except we call the Integrator's [GlobalOfflineChanges.Install] section and perform a file copy operation (using the regular INF [SourceDiskFiles], [SourceDisksNames], [DestinationDirs], and [__.Files] sections). You can use this if you're customizing for just your x86 or x64 platform and don't care if the addon is compatible with both. Compress the entries.ini with your files into a single .CAB archive.
----------------------------------------------------------------------------------------------------
Example #2b: CPL registration with dual-platform file copyCode: Select all
[general]
title = DirectX Properties Control Panel
description = Control Panel for changing properties for DirectX.
version = 9.29.1962.0
company = Microsoft Corporation
builddate = 06/23/2011
releasetype = True Addon
[GlobalOffLineChanges.Install.ntx86]
CopyFiles = DirectXCPL.x86.Files
[GlobalOffLineChanges.Install.ntamd64]
CopyFiles = DirectXCPL.x86.Files, DirectXCPL.x64.Files
[SourceDisksNames]
1 = "DirectX CPL",,,
[SourceDisksFiles]
dxcpl_x64.exe=1
dxcpl_x86.exe=1
[DestinationDirs]
DirectXCPL.x86.Files = 16425
DirectXCPL.x64.Files = 11
[DirectXCPL.x86.Files]
dxcpl.exe,dxcpl_x86.exe
[DirectXCPL.x64.Files]
dxcpl.exe,dxcpl_x64.exe
[TweaksAddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"",,0x0,"%CPL_Name%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","InfoTip",0x0,"%CPL_Tip%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","System.ControlPanel.Category",0x0,"%CPL_Category%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\DefaultIcon",,0x0,"%CPL_Icon%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%"",,0x0,"%CPL_Name%"
[Strings]
CPL_Name = "DirectX Properties"
CPL_Tip = "Changes properties for DirectX."
CPL_CmdLine = "%SystemRoot%\System32\dxcpl.exe"
CPL_Icon = "%SystemRoot%\System32\dxcpl.exe"
CPL_Category = "2"
CPL_CLSID = {262dcacb-cd4b-4ee0-88fb-792ffa1af36e}
Same as #2a, but we have platform-specific "[GlobalOfflineChanges.Install]" sections and two sets of files (appended with "_x86" and "_x64" in the source, but re-named when copied back to its original name). The reg entries are universal, but on x64 platforms the x86 file goes in SysWOW64 and the x64 file in system32 while on x86 it's just the x86 file going to system32 with the non-applicable x64 file left uninstalled. DirID 16425 ensures that the x86 file will go to system32 if it's an x86 platform, and to SysWOW64 if it's an x64 platform. DirID 16426 serves similar function for Program Files, ensuring that x86 files go to "Program Files (x86)" on x64 platforms and to regular "Program Files" on x86 platforms.
----------------------------------------------------------------------------------------------------
Example #2c: CPL registration with x86-native file copy and dual-platform registryCode: Select all
[general]
title = DirectX Properties Control Panel
description = Control Panel for changing properties for DirectX.
version = 9.29.1962.0
company = Microsoft Corporation
builddate = 06/23/2011
releasetype = True Addon
[GlobalOffLineChanges.Install.ntx86]
CopyFiles = DirectXCPL.Files
AddReg = DirectXCPL.x86.AddReg
[GlobalOffLineChanges.Install.ntamd64]
CopyFiles = DirectXCPL.Files
AddReg = DirectXCPL.x64.AddReg
[SourceDisksNames]
1 = "DirectX CPL",,,
[SourceDisksFiles]
dxcpl.exe=1
[DestinationDirs]
DirectXCPL.Files = 16425
[DirectXCPL.Files]
dxcpl.exe
[TweaksAddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"",,0x0,"%CPL_Name%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","InfoTip",0x0,"%CPL_Tip%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"","System.ControlPanel.Category",0x0,"%CPL_Category%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID%"",,0x0,"%CPL_Name%"
[DirectXCPL.x86.AddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine.x86%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\DefaultIcon",,0x0,"%CPL_Icon.x86%"
[DirectXCPL.x64.AddReg]
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine.x64%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID%"\DefaultIcon",,0x0,"%CPL_Icon.x64%"
[Strings]
CPL_Name = "DirectX Properties"
CPL_Tip = "Changes properties for DirectX."
CPL_Category = "2"
CPL_CmdLine.x86 = "%SystemRoot%\System32\dxcpl.exe"
CPL_Icon.x86 = "%SystemRoot%\System32\dxcpl.exe"
CPL_CmdLine.x64 = "%SystemRoot%\SysWOW64\dxcpl.exe"
CPL_Icon.x64 = "%SystemRoot%\SysWOW64\dxcpl.exe"
CPL_CLSID = {262dcacb-cd4b-4ee0-88fb-792ffa1af36e}
Same as above, but this assumes we have just an x86 file and want to install it in the right place whether you're on an x86 or x64 platform. Same file copy operation as #2b, with DirID 16425 slotting it in the right place for either platform. But the reg entries are split into 3 sections: [TweaksAddReg] for universal registration, and two platform-specific sections called out by the [GlobalOffLineChanges.Install] sections using the regular INF AddReg directive. Here we cut/paste out the reg lines for the .EXE launcher and icon entries from [TweaksAddReg] into the platform-specific reg sections and customize each to point to system32 on x86 platforms and SysWOW64 on x64 platforms. Note that if you want to use DirID's directly in the reg entry pathnames, you cannot use strings (DirID's don't expand properly from strings, so you'd have to manually paste the file/icon path into the reg lines). This is often preferable because using DirID 16425 saves having to separate out the AddReg sections like this, but if you want to keep it clean and only have to touch the strings this template works best.
----------------------------------------------------------------------------------------------------
Other info...
The reg line for launching the CPL can include arguments. For example, if you're launching UserPasswords2 the "CPL_CmdLine" string would be: "%SystemRoot%\system32\control.exe userpasswords2". And so on (RUNDLL32.EXE if you're launching a DLL, etc.).
Each CPL you register needs its own unique GUID/CLSID, which you can generate here:
http://www.guidgenerator.com/. If registering multiple CPL's in one addon you may want to do away with the strings and just manually copy each set of reg entries whole. Or you can template the reg syntax and just append a suffix on each string both in the reg entries and in the strings...i.e. . .
Code: Select all
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"",,0x0,"%CPL_Name1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"","InfoTip",0x0,"%CPL_Tip1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"","System.ControlPanel.Category",0x0,"%CPL_Category1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"\DefaultIcon",,0x0,"%CPL_Icon1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine1%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID1%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID1%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID1%"",,0x0,"%CPL_Name1%"
;
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"",,0x0,"%CPL_Name2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"","InfoTip",0x0,"%CPL_Tip2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"","System.ControlPanel.Category",0x0,"%CPL_Category2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"\DefaultIcon",,0x0,"%CPL_Icon2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"\Shell",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"\Shell\Open",,0x10
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"\Shell\Open\Command",,0x20000,"%CPL_CmdLine2%"
HKLM,"SOFTWARE\Classes\CLSID\%CPL_CLSID2%"\ShellFolder","Attributes",0x10001,00,00,00,00
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID2%""
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\%CPL_CLSID2%"",,0x0,"%CPL_Name2%"
[Strings]
CPL_Name1 = "Registry Editor"
CPL_Tip1 = "Add and edit registry keys and values, restore the registry from a backup or to default values, and import or export keys for reference or backup."
CPL_Category1 = 5
CPL_CmdLine1 = "%SystemRoot%\regedit.exe"
CPL_Icon1 = "%SystemRoot%\regedit.exe,-100"
CPL_CLSID1 = {2d805cd4-85e6-44ad-bb3c-4711941d0ec8}
;
CPL_Name2 = "DirectX Properties"
CPL_Tip2 = "Changes properties for DirectX."
CPL_CmdLine2 = "%SystemRoot%\System32\dxcpl.exe"
CPL_Icon2 = "%SystemRoot%\System32\dxcpl.exe"
CPL_Category2 = "2"
CPL_CLSID2 = {262dcacb-cd4b-4ee0-88fb-792ffa1af36e}
The "System.ControlPanel.Category" line sets where the CPL appears in Category view:
0 : Other Control Panel Options (any tool that does not specify a category ID is placed in this category)
1 : Appearance and Themes
2 : Printers and Other Hardware
3 : Network and Internet Connections
4 : Sounds, Speech, and Audio Devices
5 : Performance and Maintenance
6 : Date, Time, Language, and Regional Options
7 : Accessibility Options