Registry key exists check error

Mar 19, 2010 at 10:41 AM

Hi,

I'm having a configuration with a component witch installedcheck looks if a certain registry key exists:

 

 <component package="#APPPATH\Prerequisites\SQL CLR Types\SQLSysClrTypes.msi" cmdparameters="/qn" cmdparameters_silent="/qn" cmdparameters_basic="/qb" os_filter_greater="" os_filter_smaller=""
  os_filter_lcid="" type="msi" installcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" required="True"
  description="SQL CLR Types" note="" processor_architecture_filter="" status_installed="(Installed)" status_notinstalled="Installed" display_name="Microsoft SQL Server System CLR Types">
     <installedcheck path="SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes" fieldname="" fieldvalue="" fieldtype="REG_SZ" comparison="exists" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE"
  type="check_registry_value" description="Installed Check" />
    </component>

In the log file it finds the registry key but it seems to fail to read it's value:

 

2010-03-19 11:28:39	Registry key found: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes\
2010-03-19 11:33:37	Error: 0x80070002 - Error quering 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes\' value size: The system cannot find the file specified.
2010-03-19 11:33:37	dotNetInstaller finished, return code=-1

The problem with this key is that it exists in the registry but it has no value (from regedit) :   

 

Name        Type     Data
(Default)   REG_SZ   (value not set)

 

How could I build a installedcheck that verify if the registry key just exists, without having a value ?

 

Thanks,

Cristian

 

 

2010-03-19 11:28:39 Registry key found: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes\
2010-03-19 11:33:37 Error: 0x80070002 - Error quering 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes\' value size: The system cannot find the file specified.
2010-03-19 11:33:37 dotNetInstaller finished, return code=-1

 

 

 

 

Coordinator
Mar 19, 2010 at 3:40 PM

It's a bug. I fixed it in http://dotnetinstaller.codeplex.com/releases/view/39966 (build 1.9.5705.0). Please try it, let me know if it works.

 

Mar 19, 2010 at 4:19 PM

Now it doesn't detect the key:

 

2010-03-19 17:11:09 Checking registry key: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes
2010-03-19 17:11:09 *** No registry value found: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes, default value: false
2010-03-19 17:11:09 -- Microsoft SQL Server System CLR Types (Microsoft SQL Server System CLR Types): NOT INSTALLED

 

2010-03-19 17:11:09	Checking registry key: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes
2010-03-19 17:11:09	*** No registry value found: SOFTWARE\Microsoft\Microsoft SQL Server\RefCount\SQLSysClrTypes, default value: false
2010-03-19 17:11:09	-- Microsoft SQL Server System CLR Types (Microsoft SQL Server System CLR Types): NOT INSTALLED

The key is in the registry but it seems that dNI sees that it has no value and it considers the key as not existent.

I was looking for a way to detect the existence of a registry key even if it has no value. Unfortunately, the installation of  Microsoft SQL Server System CLR Types  creates just that key but it doesn't assign any value to it.

Regards,

Cristian

 

 

Coordinator
Mar 19, 2010 at 4:24 PM

Yeah, this is going to be more complicated. Dni needs to figure out whether you want to check whether there's a value in the default key or just the key. I can think of several strategies:

  • Change the default to check whether a key exists when fieldvalue is blank. Add a "default" fieldvalue to check for the default key.
  • Breakup the exists operator into a key_exists or value_exists.

Thoughts?

Coordinator
Mar 20, 2010 at 1:34 AM

Update: I've uploaded build 1.9.5732.0.

I ended up adding key_exists and value_exists operators to registry installed checks. The value_exists operator allows one to check whether the default registry key value is set. The default exists is a bit more brainless, as it's auto-picking what to do, ie. it checks whether the key exists if the fieldname is not specified and checks whether the value exists if it is. 

Give it a try.

Mar 22, 2010 at 9:25 AM

I've tried with this latest build and it seems to work. Just let exists and no fieldname.

Thanks