Reference/WriteRegExpandStr: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with "WriteRegExpandStr root_key subkey key_name value Write a string to the registry. root_key must be one of: *''HKCR'' or ''HKEY_CLASSES_ROOT'' *''HKLM'' or ''HKEY_LOCAL_MACHINE''...") |
No edit summary |
||
Line 15: | Line 15: | ||
If root_key is ''SHCTX'' or ''SHELL_CONTEXT'', it will be replaced with HKLM if [[Reference/SetShellVarContext|SetShellVarContext]] is set to all and with HKCU if [[Reference/SetShellVarContext|SetShellVarContext]] is set to current. | If root_key is ''SHCTX'' or ''SHELL_CONTEXT'', it will be replaced with HKLM if [[Reference/SetShellVarContext|SetShellVarContext]] is set to all and with HKCU if [[Reference/SetShellVarContext|SetShellVarContext]] is set to current. | ||
The error flag is set if the string could not be written to the registry. The type of the string will be REG_SZ for [[Reference/WriteRegStr|WriteRegStr]], or REG_EXPAND_STR for | The error flag is set if the string could not be written to the registry. The type of the string will be REG_SZ for [[Reference/WriteRegStr|WriteRegStr]], or REG_EXPAND_STR for WriteRegExpandStr. If the registry key doesn't exist it will be created. | ||
<highlight-nsis>WriteRegExpandStr HKLM "Software\My Company\My Software" "Expand String Value" "%WINDIR%\notepad.exe"</highlight-nsis> | <highlight-nsis>WriteRegExpandStr HKLM "Software\My Company\My Software" "Expand String Value" "%WINDIR%\notepad.exe"</highlight-nsis> |
Revision as of 17:08, 25 November 2011
WriteRegExpandStr
root_key subkey key_name value Write a string to the registry. root_key must be one of:
- HKCR or HKEY_CLASSES_ROOT
- HKLM or HKEY_LOCAL_MACHINE
- HKCU or HKEY_CURRENT_USER
- HKU or HKEY_USERS
- HKCC or HKEY_CURRENT_CONFIG
- HKDD or HKEY_DYN_DATA
- HKPD or HKEY_PERFORMANCE_DATA
- SHCTX or SHELL_CONTEXT
If root_key is SHCTX or SHELL_CONTEXT, it will be replaced with HKLM if SetShellVarContext is set to all and with HKCU if SetShellVarContext is set to current.
The error flag is set if the string could not be written to the registry. The type of the string will be REG_SZ for WriteRegStr, or REG_EXPAND_STR for WriteRegExpandStr. If the registry key doesn't exist it will be created.
WriteRegExpandStr HKLM "Software\My Company\My Software" "Expand String Value" "%WINDIR%\notepad.exe"