Reg2Nsis - convert registry info into NSIS commands

From NSIS Wiki

Author: z_artem (talk, contrib)


Converts registry information (from registry itself or REG-file) into NSIS-script commands. Automatically substitutes $WINDIR, $SYSDIR, $PROGRAMFILES and $COMMONFILES constants instead of corresponding special folder names (based on current Windows settings). Include generated script into your installer with the !include

InstallContextMenu utility adds/removes "Convert to nsis script" item to REG-files context menu (right-button click on file).

The latest version is 0.14.

Download

Reg2Nsis011.zip (170 KB)
Download from original website

Usage

Reg2Nsis (reg-file | reg-key) [-r] [(-o nsis-file | -O)]

Parameters

reg-file
  take values from the specified REG-file
reg-key
  take values from the specified registry key
-r
  iterate through registry subkeys recursively (if source
  is registry key)
-o nsis-file
  send generated NSIS-script to the specified file
-O
  send output to the file with the same name as inputed REG-file
  but with the .nsh file extension
-s
  disable special folder substitution

Examples

convert registry key into NSIS-commands:

Reg2Nsis "HKEY_CURRENT_USER\Software\Microsoft\Notepad"

convert registry key and all its subkeys into NSIS-commands:

Reg2Nsis "HKEY_CURRENT_USER\Software\Microsoft\Notepad" -r

convert saved registry file into NSIS-commands. File settings.nsh is used as output:

Reg2Nsis settings.reg -O

Author

Artem Zankovich <aarrtteemm(at)nm.ru>

History

  • 0.14 (17.06.2010)
    • Another fix for negative one-digit hex values export from registry (thanks to Khokhlov Nickolay for bug-report)
  • 0.13 (11.06.2010)
    • Fixed one-digit hex values export from registry (thanks to Khokhlov Nickolay for bug-report)
  • 0.12 (07.02.2010)
    • Fixed quote character substitution in .reg-files (thanks to Fred for bug-report)
  • 0.11 (20.10.2006)
    • Bug with multiline values in regedit4 file is fixed (thanks to Vadims Zenins for bug-report)
  • 0.10 (31.08.2005)
    • Bug with values that ends with "\" is fixed (thanks to Dekel Cohen)
  • 0.09 (09.05.2005)
    • Multiple-line values are supported for non-Unicode REG-files (thanks to Vadims Zenins for bug-report)
    • Unicode bug fixed
    • Removed substitution of "\r", "\n" and "\t" to "$\r", "$\n" and "$\t" for REG-files
  • 0.08 (01.04.2005)
    • Special folders substitution added (enabled by default) (idea of Vadims Zenins)
    • Option -s disables special folders substitution
    • Reg2Nsis changes "$", "\r", "\n" and "\t" to "$$", "$\r", "$\n" and "$\t"
  • 0.07 (29.03.2005)
    • Reg2Nsis processed large .reg-files incorrect. Fixed.
    • Convert "\\" into "\" in .reg-file key names (thanks to Vadims Zenins for bug-reports)
    • default extension of generated file changed to .nsh
  • 0.06 (09.10.2004)
    • Bug fix (thanks to Michiel Hazelhof again)
  • 0.05 (03.10.2004)
    • DeleteRegKey for keys with minus at the beginning (standard way to delete registry keys with .reg files, thanks to Michiel Hazelhof for report)
  • 0.04 (17.08.2004)
    • bug with loosing default values (started with @) is fixed (thanks to Stephan H. Wissel for report)
  • 0.03 (21.01.2004)
    • Option -O added
    • REG-files context menu command installer added. The command it adds is 'Convert to nsis script' (idea of David Lewis)
  • 0.02 (12.07.2003)
    • comments indicate begin and end of generated script
    • empty keys are created henceforth
  • 0.01 (10.07.2003)
    • initial release
Personal tools
donate