Old 31st July 2018, 13:53   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
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 is offline   Reply With Quote
Old 31st July 2018, 14:08   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
Try Process Monitor. Maybe your program only works when certain keys already exist?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 31st July 2018, 21:03   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
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 is offline   Reply With Quote
Old 31st July 2018, 21:51   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
Look for a copy/backup operation on your key.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st August 2018, 08:18   #5
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
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
Gluck is offline   Reply With Quote
Old 4th August 2018, 14:56   #6
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Is there something wrong?

Have you detected a possible reason?
Gluck is offline   Reply With Quote
Old 4th August 2018, 15:04   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th August 2018, 12:57   #8
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Thanks.
Gluck 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