Adding your program to the Control Panel: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.) |
m (Added category links.) |
||
Line 53: | Line 53: | ||
Written by [[ZmAn3]].<br> | Written by [[ZmAn3]].<br> | ||
Modified by [[deguix]]. | Modified by [[deguix]]. | ||
[[{{ns:14}}:Windows Shell Integration Functions]] |
Revision as of 21:36, 30 April 2005
Author: ZmAn3 (talk, contrib) |
Description
These macros below add or remove items from the Control Panel. You have to refresh the Control Panel, if in use, in order to work. Tested only on Windows XP SP2.
How To Use
${WControlPanelItem_Add} `GUID` `Name` `Tip` `Exec` `Icon`
- GUID
- Your application GUID. If you don't have one, use the function from Create a GUID, a Globally Unique Identifier page.
- Name
- Name of the item to appear as the button name.
- Exec
- File to open when executing the item. It has to be an executable. Accepts parameters.
- Icon
- Specifies the icon to be used for the item.
${WControlPanelItem_Remove} `GUID`
- GUID
- Your application GUID used on ${WControlPanelItem_Add}.
The Macros
!define WControlPanelItem_Add `!insertmacro WControlPanelItem_Add` !macro WControlPanelItem_Add `GUID` `Name` `Tip` `Exec` `Icon` WriteRegStr HKCR `CLSID\${GUID}` `` `${Name}` WriteRegStr HKCR `CLSID\${GUID}` `InfoTip` `${Tip}` WriteRegStr HKCR `CLSID\${GUID}\DefaultIcon` `` `${Icon}` WriteRegStr HKCR `CLSID\${GUID}\Shell\Open\Command` `` `${Exec}` WriteRegDWORD HKCR `CLSID\${GUID}\ShellFolder` `Attributes` `0` WriteRegStr HKLM `SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\${GUID}` `` `${Name}` !macroend !define WControlPanelItem_Remove `!insertmacro WControlPanelItem_Remove` !macro WControlPanelItem_Remove `GUID` DeleteRegKey HKCR "CLSID\${GUID}" DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\${GUID}" !macroend