Old 9th November 2012, 16:09   #1
zumbo
Junior Member
 
Join Date: Nov 2012
Posts: 3
Writing to registry becomes terribly slow

My installer seems to be "stuck" in the middle of execution for about a minute. Debugging revealed that two harmless looking registry commands each take about 30 seconds:

WriteRegBin HKLM "SYSTEM\ControlSet001\services\openmapdrive" "FailureActions" 80510100000000000000000003000000140000000100000060ea000000000000000000000000000000000000

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "OpenMapSysTray" "$INSTDIR\drive\OpenmapSystray.exe"

It only happens when I install a large amount of data (> 100 MB) some lines before. It works fine when I comment out this data, and also if I comment out the two registry commands (previous and subsequent calls to WriteRegStr work OK). I have no idea what could cause these commands to become so slow. Any ideas?
zumbo is offline   Reply With Quote
Old 9th November 2012, 17:34   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
I don't know what might be causing this other than the disk cache forcing the registry be paged out but I do know that writing to ControlSet001 is probably wrong, 99.99% of the time you want the currentcontrolset!

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th November 2012, 07:11   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Here's a crazy idea: How about first writing to registry, and then installing the >100MB data files?
MSG is offline   Reply With Quote
Old 12th November 2012, 09:56   #4
zumbo
Junior Member
 
Join Date: Nov 2012
Posts: 3
@Anders: Thanks for pointing out the ControlSet problem. The speed problem, however, can't be caused by the disk cache, since it happens invariably at the same two lines, on different machines, with different memory sizes. It must be caused by some memory problem internal to NSIS.

@MSG: I tried that as a workaround, but now the installer freezes at the end, that is, the "Finish" button stays grayed out for about 40 seconds, although installation is complete. Which strengthens my suspicion that NSIS has problems handling the memory it has allocated for the 100MB+ of data.
zumbo is offline   Reply With Quote
Old 12th November 2012, 13:27   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Could it be related to a virusscanner hogging your system? A good way to test would be to disable all security software and compare results.
MSG is offline   Reply With Quote
Old 12th November 2012, 15:11   #6
zumbo
Junior Member
 
Join Date: Nov 2012
Posts: 3
@MSG: Yes, indeed, when I disable my virus scanner, the lockup is gone. Thanks! Although I still don't understand why the lockup happens at two specific lines in the script. Also, when I replace the NSIS registry commands with nsExec::ExecToStack "reg add [...]", it becomes much faster (about 15 s instead of 30 s lockup per call).
zumbo 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