감사합니다. 해당 웹사이트에 좋은 정보들이 많이 있내요.
nansama 님이 쓰신 글 :
: 질문을 정확히 모르겠지만 레지스트리 처리 관련해서 NSIS 오픈소스 ( nsis.sourceforge.net )
: 를 참고 하면 다음과 같이 처리 하고 있습니다.
:
:
:
: void NSISCALL myRegGetStr(HKEY root, const char *sub, const char *name, char *out, int x64)
: {
: HKEY hKey;
: *out=0;
: if (RegOpenKeyEx(root,sub,0,KEY_READ|(x64?KEY_WOW64_64KEY:0),&hKey) == ERROR_SUCCESS)
: {
: DWORD l = NSIS_MAX_STRLEN;
: DWORD t;
: if (RegQueryValueEx(hKey,name,NULL,&t,out,&l ) != ERROR_SUCCESS || (t != REG_SZ && t != REG_EXPAND_SZ)) *out=0;
: out[NSIS_MAX_STRLEN-1]=0;
: RegCloseKey(hKey);
: }
: }
:
: // based loosely on code from Tim Kosse
: // in win9x this isn't necessary (RegDeleteKey() can delete a tree of keys),
: // but in win2k you need to do this manually.
: static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
: {
: HKEY key;
: int retval=RegOpenKeyEx(thiskey,lpSubKey,0,AlterRegistrySAM(KEY_ENUMERATE_SUB_KEYS),&key);
: if (retval==ERROR_SUCCESS)
: {
: // NB - don't change this to static (recursive function)
: char buffer[MAX_PATH+1];
: while (RegEnumKey(key,0,buffer,MAX_PATH+1)==ERROR_SUCCESS)
: {
: if (onlyifempty)
: {
: RegCloseKey(key);
: return !ERROR_SUCCESS;
: }
: if ((retval=myRegDeleteKeyEx(key,buffer,0)) != ERROR_SUCCESS) break;
: }
: RegCloseKey(key);
: {
: typedef LONG (WINAPI * RegDeleteKeyExAPtr)(HKEY, LPCTSTR, REGSAM, DWORD);
: RegDeleteKeyExAPtr RDKE = (RegDeleteKeyExAPtr)
: myGetProcAddress(MGA_RegDeleteKeyExA);
:
: if (RDKE)
: retval=RDKE(thiskey,lpSubKey,AlterRegistrySAM(0),0);
: else
: retval=g_exec_flags.alter_reg_view||RegDeleteKey(thiskey,lpSubKey);
: }
: }
: return retval;
: }
:
:
:
: 향수 님이 쓰신 글 :
: : 프로그램 추가/제거 어느정도는 구현을 하였습니다..
: :
: : 문제가 리스트중에 업데이트 관련은 예외 처리 해야하며 64/32비트 차이랑 있내요..
: :
: : 2가지 문제 점이있어서 그렇습니다..
: :
: : 마이크로소프트에서 따로 지원 하는 api 있나해서 문의 드립니다..
: :
: : 아니면 업데이트 관련 부분은 예외 처리하는 부분 힌트라도 좀 부탁드립니다~
: :
: : 간단한 형식은.
: : 아래 처럼 구현 하였습니다.. 코딩 부분이 전체 적으로 복사를안했기에 코딩이 안맞습니다. 참고해주세요..
: :
: :
: : TRegistry *reg = new TRegistry;
: : TStringList *UnKey = new TStringList;
: : reg->RootKey = HKEY_LOCAL_MACHINE;
: : if( reg->OpenKey("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall",False))
: : {
: : reg->GetKeyNames(UnKey);
: : reg->CloseKey();
: : }
: : int a = 0 ;
: : for ( int j=0 ; j < UnKey->Count ; j++)
: : {
: : if( reg->OpenKey("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + UnKey->Strings[j],False))
: : {