Skip to content
⌘ NSIS Forum Archive

Registry operations

7 posts

Gluck#

Registry operations

Always using NSIS as a portabilizer:

If I have a file.reg of this type:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\...]
[HKEY_USERS\S-1-5-21-...]
[HKEY_CURRENT_USERS\...]

Can I copy/remove/update in one shot different keys?
What must I write?

Thanks.
Anders#
The Registry plug-in on the wiki has some .reg file support IIRC and there might be a converter on the Wiki as well but NSIS itself does not support .reg files.
Gluck#
Sorry, what is IIRC?

I haven't understood the function o plugin and if is it loaded.

In the NSIS console I can read:

PLUG-INS
Ad Splash
...
Nsisdl
Splash
...

The registry.dll file is placed in Plugins folder...
Is it loaded?
How can I verify if it works correctly?

About the converter:
I have downloaded Reg2Nsis. It convert a .reg in a different sintax.
(But I'll ask about it soon!).
Gluck#
Registry calls

I'm learning how to program NSIS for portabilization.
The only tutorial I have found is this:



I have downloaded the Audacity example (about registry) and I have read:

In .nsi file:

; **************
; === Includes ===
; **************
!include "Registry.nsh"
...
Function Init
WriteRegDWORD HKEY_CURRENT_USER "Software\Audacity\Audacity" "WantAssociateFiles" 0x0
WriteRegStr HKEY_CURRENT_USER "Software\Audacity\Audacity\Directories" "TempDir" "$TEMP\${APP}PortableTemp\"
WriteRegStr HKEY_CURRENT_USER "Software\Audacity\Audacity\MP3" "MP3LibPath" "$EXEDIR\App\LAME\lame_enc.dll"
FunctionEnd




And in Registry.nsh file:


WriteRegDWORD HKEY_CURRENT_USER "Software\Audacity\Audacity" "WantAssociateFiles" 0x0

WriteRegStr HKEY_CURRENT_USER "Software\Audacity\Audacity\Directories" "TempDir" \
"C:\DOCUME~1\Admin\LOCALS~1\Temp\AudacityPortableTemp\"

WriteRegStr HKEY_CURRENT_USER "Software\Audacity\Audacity\MP3" "MP3LibPath" \
"L:\PortableApps\AudacityPortable\App\LAME\lame_enc.dll"

Are both converted with Reg2Nsis, but have different syntax...

WHY???

thanks
Gluck#
I'm refering about the .nsi file trace a relative path, while .nsh has the same path, but in absolute way...

What does it means?
Why two?
The second registry (.nsh) is important?
Can I delete it?
Anders#
A file with $EXEDIR and other variables have probably not been converted or somebody changed "L:\PortableApps\AudacityPortable" to "$EXEDIR" by hand.

If you don't understand these simple concepts then you should not be writing portable applications IMHO.