Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Substring Search (http://forums.winamp.com/showthread.php?t=287129)

emartineau 18th February 2008 18:57

Substring Search
 
Hi,

I'am trying to write a script that find the path to an OCX or a DLL.

code:

Section "Apex Test" Apex_01

;Open search
registry::Open /NOUNLOAD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs" "/N='apexexchangeXcontrol2.ocx'" .r0
StrCmp $0 -1 error

registry::Find /NOUNLOAD .r1 .r2 .r3 .r4

MessageBox MB_OKCANCEL '$$1 "path" =[$1]$\n\
$$2 "value" =[$2]$\n\
$$3 "string" =[$3]$\n\
$$4 "type" =[$4]$\n\
$\n\'

;Close search
registry::Close

error:


SectionEnd



The problem is that i have to give the full path ("/N='C:\Windows\system32\apexexchangeXcontrol2.ocx'") so that the plugins returm a result.

Is there a way to search for a substring in the key?

Anders 18th February 2008 19:06

nsis already has built in registry support for this, use EnumRegValue and parse each path returned and look for your ocx/dll, to parse the returned string, you can do it yourself, or use the GetFileName macro (see E.1 "File Functions Header" in the nsis help file)


All times are GMT. The time now is 04:20.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.