Skip to content
⌘ NSIS Forum Archive

Registry.nsh

8 posts

Gluck#

Registry.nsh

Hi,

I have noticed a strange behaviour in NSIS (as a launcher)...

Many days ago I have reformatted my HD.
From that moment, ALL THE PROGRAMS that I've portabilized (and use registry backup) with NSIS failed to run.

Or better, the launcher start the program but it doesn't backup/restore the registry data.
And all that programs worked fine before reformatting HD...

The programs that doesn't use registry.nsh still works fine.

May this be caused by a bug in NSIS or in registry.nsh?

Thanks
Gluck#
I don't know what looking for...

All the programs never works.

Even if I use ProcessMonitor, what should I control?

The keys in regedit are all new and blank (like new installation or unregistred programs).

All the old backup keys are deleted (as programmed) on exit the program.
But the new keys are not backupped.
Gluck#
The code is this, and worked fine for months:


Section "MOUNT REGKEY"

!include "Registry.nsh"

!define REGKEY1 "HKEY_CURRENT_USER\Software\MyApp"
!define DATAKEY1 "$EXEDIR\Data\MyApp.reg"


${registry:😁eleteKey} "${REGKEY1}-BackupBy${APPNOSPACE}Portable" $R0
Sleep 200

${registry::MoveKey} "${REGKEY1}" "${REGKEY1}-BackupBy${APPNOSPACE}Portable" $R0
Sleep 200

${registry::RestoreKey} "${DATAKEY1}" $R0
Sleep 200

SectionEnd




Section "UNMOUNT REGKEY"

Delete "${DATAKEY1}"

${registry::SaveKey} "${REGKEY1}" "${DATAKEY1}" "/A=1" $R0
Sleep 200

${registry:😁eleteKey} "${REGKEY1}" $R0
Sleep 200

${registry::MoveKey} "${REGKEY1}-BackupBy${APPNOSPACE}Portable" "${REGKEY1}" $R0
Sleep 200

${registry::Unload}

SectionEnd
Anders#
All I can suggest is Process Monitor. Try to find the operations that correspond to your script actions and look at those that fail, and why.