Old 11th May 2007, 22:30   #1
chivalri
Junior Member
 
Join Date: Apr 2007
Location: Houston
Posts: 20
Registry Data held in memory?

PHP Code:
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Microsoft SQL Native Client\CurrentVersion" "Version" 
I have three sections that can be installed independent of one another that use SQL Express. I check in each section to see if SQL Express is installed (I do not want to install it if it is already there) by using the above command.

If I run the installer and select two or more of the sections that run this check, all three will download and run the SQL.

If I only choose one section the rerun the installer and add another section, the check works and the SQL is not loaded.

I ran a test. I installed just one of the sections then put in code to halt the install. I had opened regedit prior to starting the installer. The regedit did not show the added key and value at the break. I then closed and restarted regedit and the key was there.

I added a message box to display $R1 but it was blank all three times during the first run that SQL was not previously installed. If SQL was there before I ran the SQLinstaller, $R1 displayed the Version number.

How do I get my installer to notice that a new registry key has been added without requiring the installer to be closed and restarted?
chivalri is offline   Reply With Quote
Old 11th May 2007, 23:03   #2
goldy1064
Senior Member
 
Join Date: Jun 2005
Posts: 211
Why not put the entire SQL Express check/install into one hidden section that is only run if any of the sections that require it need it?
goldy1064 is offline   Reply With Quote
Old 12th May 2007, 00:53   #3
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
I've seen new data appear in RegEdit without closing and reopening it, but sometimes I need to hit F5 Refresh. Have you tried that?

What OS are you running, maybe that makes some difference.

Don
demiller9 is offline   Reply With Quote
Old 12th May 2007, 08:49   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
How do I get my installer to notice that a new registry key has been added without requiring the installer to be closed and restarted?
There isn't such case, installer reads changed registry normally, check this code below,
code:
outfile 'regtest.exe'

section -

ReadRegStr $0 HKCU "Software\_Registry_Test" "test"
MessageBox MB_OK "$$0 == {$0}"

IfErrors 0 +4

WriteRegStr HKCU "Software\_Registry_Test" "test" "Registry updated"
ReadRegStr $0 HKCU "Software\_Registry_Test" "test"
MessageBox MB_OK "$$0 == {$0}"

DeleteRegKey HKCU "Software\_Registry_Test"

sectionend


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 13th May 2007, 01:23   #5
chivalri
Junior Member
 
Join Date: Apr 2007
Location: Houston
Posts: 20
code:

DetailPrint "Pausing installation while downloaded SQL Express installer runs."
ExecWait '$TEMP\SQLinstaller.exe /qb sapwd=password disablenetworkprotocols=0 securitymode=SQL INSTANCENAME=MSSQLSERVER ADDLOCAL=SQL_Engine'

ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Microsoft SQL Native Client\CurrentVersion" "Version"



If I run this, $R1 is blank. Exit installer and check registry and this value is set. What am I missing?
chivalri is offline   Reply With Quote
Old 13th May 2007, 02:16   #6
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
There's a good chance that the SQLInstaller.exe unpacks some files and then starts another exe. If it exits before the other exe finishes, your script will check the registry before the actual installer has created the entries, but they will be there when you check for them.

Verify the SQLInstaller.exe spawns another process and exits before it finishes with something like ProcExp.exe (Process Explorer) that can be downloaded from SysInternals

Don
demiller9 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