Old 16th April 2018, 09:00   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 85
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.
Gluck is offline   Reply With Quote
Old 16th April 2018, 13:43   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th April 2018, 11:53   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 85
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 is offline   Reply With Quote
Old 17th April 2018, 12:05   #4
Gluck
Member
 
Join Date: Apr 2018
Posts: 85
Registry calls

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

http://en.pafd.xyz/tutorial/portable...-tutorial.html

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 is offline   Reply With Quote
Old 17th April 2018, 12:13   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
Are you talking about the \ ?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th April 2018, 17:20   #6
Gluck
Member
 
Join Date: Apr 2018
Posts: 85
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?
Gluck is offline   Reply With Quote
Old 17th April 2018, 20:15   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump