NSIS delete registry value

I searched “nsis delete registry value” on google, but found that search results are not really helpful. So I decide to write this post to introduce how to delete registry value (or how to delete registry string).

Deleting registry value need use DeleteRegValue instruction

DeleteRegValue root_key sub_key value_name

If I need to delete a value named “DisplayName” under “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Pooler” (This is the entry name in Add/Remove Programs in Windows XP or Program & Features in Windows 7/8), I could use:

DeleteRegValue HKLM “Software\Microsoft\Windows\CurrentVersion\Uninstall\Pooler” “DisplayName”

And we can check this value by using ReadRegStr and MessageBox:

ReadRegStr $0 HKLM “Software\Microsoft\Windows\CurrentVersion\Uninstall\Pooler” “DisplayName”

MessageBox MB_OK $0

 

Have fun with NSIS!