Skip to content
⌘ NSIS Forum Archive

InstallDirRegKey does not work for me.

6 posts

lll2008#

InstallDirRegKey does not work for me.

I am a new user of NSIS (just started to play with it today). I used:

InstallDirRegKey HKLM "SYSTEM\CurrentControlSet\Control\ServiceProvider\ServiceTypes\Microsoft Internet Information Server" ""

or

HKLM "SYSTEM\CurrentControlSet\Control\ServiceProvider\ServiceTypes" "Microsoft Internet Information Server"

to check if iis has been installed, but neither worked for me. I am sure the key is there! I also tried to add a key to SOFTWARE, and InstallDirKey did not work for me either. Please refer to my script file (attached).

Could you tell me what the problem is? Or any suggestion on this?

Thank you in advance!

li
lll2008#
Hi Joost,
I am trying to check if iis is installed before I install my components. I suppose if the iis key is there InstallDirRegKey HKLM "SYSTEM\CurrentControlSet\Control\ServiceProvider\ServiceTypes\Microsoft Internet Information Server" "" will return a folder to INSTDIR, otherwise INSTDIR will be empty. But apprently this does not work for me. Even though the key is there, the InstallDirRegKey still returns an empty string. Please check the attachement in my first post.

Any suggestion?

Thanks,
kichik#
Are you sure it contains a valid directory path? If it doesn't contain a valid directory path, nothing will get into $INSTDIR. If you want to read this value, which is not a directory path, you should use ReadRegStr and not InstallDirRegKey.

BTW, you can use RegDLL instead of executing regsvr32 which doesn't exist on every Windows machine.