Skip to content
⌘ NSIS Forum Archive

Write REG-File in Registry

9 posts

Biarchiv#

Write REG-File in Registry

I want write this in the registry.
A simple code.

Can I have a simple code to clear it if uninstall from registriy?


REGEDIT4
[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen]
@="Mit &Notepad öffnen"
[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen\command]
@="notepad.exe \"%1\""
Thank you...
Joost Verburg#
Use NSIS commands like WriteRegStr and DeleteRegValue to modify registry information. See the users manual for details.
Vytautas#
For info about associating file types and unassociating in uninstall check out my NSIS Archive page.

Vytautas 😁
Biarchiv#
Hello,

This???

WriteRegStr"[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen]@="Mit &Notepad öffnen""
kichik#
No, that's not proper usage. See the manual for usage explanation and the examples (Examples folder, Archive and this forum) for usage examples.
deguix#
If you don't want to look in the documentation...:

WriteRegStr "file.ini" "Section" "Value Name" "Value" 
Very easy (for me)...
Vytautas#
Originally posted by deguix
If you don't want to look in the documentation...:

WriteRegStr "file.ini" "Section" "Value Name" "Value" 
Very easy (for me)...
One problem with your excample is that the registry does NOT have 'file.ini' it should be HKEY-... entry depending on the registry branch you want to use.

Vytautas
Biarchiv#
I read Doku bud I have experimtened with this and EXE-entry.
Then I change it and Windows can not open exe files in future.
I must format and reinstall it.


[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen]
@="Mit &Notepad öffnen"
[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen\command]
@="notepad.exe \"%1\""

WriteRegStr_"HKEY_CLASSES_ROOT"_"\*\shell\MitNpOeffnen"_"Mit &Notepad öffnen"_""
WriteRegStr_"HKEY_CLASSES_ROOT"_"\*\shell\MitNpOeffnen\command"_"Mit &Notepad öffnen"_"$INSTDIR\Programm.exe"

;clear
DeleteRegValue "HKEY_CLASSES_ROOT"_"\*\shell\MitNpOeffnen"_"Mit &Notepad öffnen"_""
kichik#
It should be:

WriteRegStr HKCR "*\shell\MitNpOeffnen" "" "Mit &Notepate öffnen"
WriteRegStr HKCR "*\shell\MitNpOeffnen\command" "" '"$INSTDIR\Programm.exe"'
#...
DeleteRegKey HKCR "*\shell\MitNpOeffnen"