You are here

Registry in NSIS

4 posts / 0 new
Last post
Jacob Mastel
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-06-13 19:36
Registry in NSIS

I have an app I'm working on and I'm not sure how to handle it's registry entries. All the settings are stored in the registry and I'm not quite sure how to handle that. I know I'm supposed to put them into an .ini but where do I go from there? Do I copy them to the registry when the app runs then copy them from the registry in the .ini when the app closes? If so can somebody give me a line of code as example. Bare with me it's hard to pick examples out of the huge launchers.

ZachHudock
ZachHudock's picture
Offline
Last seen: 1 year 3 months ago
Developer
Joined: 2006-12-06 18:07
You don't move the registry

You don't move the registry info into an ini. Registry stuff backs up a local copy, moves the portable settings into place (if they exist, otherwise it lets the app create the defaults), then on close moves the portable settings to a .reg file in the /Data/settings directory, and moves the local settings back.

Check out PuTTy Portable, or NSIS Portable launchers.

The developer formerly known as ZGitRDun8705

digitxp
digitxp's picture
Offline
Last seen: 12 years 7 months ago
Joined: 2007-11-03 18:33
You could, in a way

try this:

ReadRegStr $VARIABLE "HKCU\Software\Appname" "Value"
WriteINIStr "$EXEDIR\INI.ini" "SectionName" "Valuename" $VARIABLE

Got it from:
http://www.nullsoft.com/free/nsis/makensis.htm#ReadRegStr
and
http://www.nullsoft.com/free/nsis/makensis.htm#WriteINIStr

Insert original signature here with Greasemonkey Script.

John T. Haller
John T. Haller's picture
Offline
Last seen: 4 hours 20 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
PuTTY

Grab the PuTTY Portable launcher. It's probably the simplest example of it.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments