Archive: Write REG-File in Registry


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...

Use NSIS commands like WriteRegStr and DeleteRegValue to modify registry information. See the users manual for details.


For info about associating file types and unassociating in uninstall check out my NSIS Archive page.

Vytautas :D


Hello,

This???

WriteRegStr"[HKEY_CLASSES_ROOT\*\shell\MitNpOeffnen]@="Mit &Notepad öffnen""


No, that's not proper usage. See the manual for usage explanation and the examples (Examples folder, Archive and this forum) for usage examples.


If you don't want to look in the documentation...:

WriteRegStr"file.ini""Section""ValueName""Value"

Very easy (for me)...

Originally posted by deguix
If you don't want to look in the documentation...:

WriteRegStr"file.ini""Section""ValueName""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

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"_""

It should be:

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