chivalri
11th May 2007 22:30 UTC
Registry Data held in memory?
ReadRegStr$R1HKLM
"SOFTWARE\Microsoft\MicrosoftSQLNativeClient\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?
goldy1064
11th May 2007 23:03 UTC
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?
demiller9
12th May 2007 00:53 UTC
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
Red Wine
12th May 2007 08:49 UTC
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,
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
chivalri
13th May 2007 01:23 UTC
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?
demiller9
13th May 2007 02:16 UTC
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