NSIS에서 레지스트리 검색
2011-11-18
만약 HKLM 하단에 밑의 이미지와 같이 ApplicationPath 라는 레지스트리 키가 있는지와
그의 값을 얻고자 한다면.. Registry 플로그인을 사용함.
http://nsis.sourceforge.net/Registry_plug-in
아래와 같이 간단히 구현할 수 있음.
!include Registry.nsh Function .onInit ${registry::Open} "HKEY_LOCAL_MACHINE" "/K=0 /V=1 /S=0 /B=1 /N='ApplicationPath'" $0 StrCmp $0 0 0 loop loop: ; $1: Path, $2: Key, $3: Value ${registry::Find} "$0" $1 $2 $3 $4 ${If} $3 == "" MessageBox MB_ICONINFORMATION|MB_OK \ "Not found." ${registry::Close} "$0" ${registry::Unload} Abort ${EndIf} ; Default install directory StrCpy $INSTDIR $3 ; Memory free ${registry::Close} "$0" ${registry::Unload} FunctionEnd
Categorized as: Programming
답글 남기기