[Meta-diff-devel] CompareShellEx CompareShellEx.dpr,1.4,1.5
Brought to you by:
undees
From: Sebastian S. <ey...@us...> - 2005-08-18 21:19:29
|
Update of /cvsroot/meta-diff/CompareShellEx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17718/CompareShellEx Modified Files: CompareShellEx.dpr Log Message: Improved shell extension registration code, especially for Windows NT and above. Index: CompareShellEx.dpr =================================================================== RCS file: /cvsroot/meta-diff/CompareShellEx/CompareShellEx.dpr,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CompareShellEx.dpr 17 Aug 2005 06:49:10 -0000 1.4 --- CompareShellEx.dpr 17 Aug 2005 21:57:14 -0000 1.5 *************** *** 337,341 **** begin for i:=Low(FGlyphs) to High(FGlyphs) do ! if FGlyphs[i]<>0 then DeleteObject(FGlyphs[i]); inherited; end; --- 337,342 ---- begin for i:=Low(FGlyphs) to High(FGlyphs) do ! if FGlyphs[i]<>0 then ! DeleteObject(FGlyphs[i]); inherited; end; *************** *** 375,385 **** else s:=RegKeys[i]; if not Reg.OpenKey(s,True) then RaiseLastOSError; if i=Low(RegKeys) then begin Reg.WriteString('',LibraryName); Reg.CloseKey; s:=s+'\InProcServer32'; ! if not Reg.OpenKey(s,True) then RaiseLastOSError; Reg.WriteString('',DllLoc); Reg.WriteString('ThreadingModel','Apartment'); --- 376,389 ---- else s:=RegKeys[i]; + if not Reg.OpenKey(s,True) then RaiseLastOSError; + if i=Low(RegKeys) then begin Reg.WriteString('',LibraryName); Reg.CloseKey; s:=s+'\InProcServer32'; ! if not Reg.OpenKey(s,True) then ! RaiseLastOSError; Reg.WriteString('',DllLoc); Reg.WriteString('ThreadingModel','Apartment'); *************** *** 388,394 **** --- 392,407 ---- Reg.CloseKey; end; + + // For Windows NT and above, add oneself to the list of + // approved shell extensions. + Reg.RootKey:=HKEY_LOCAL_MACHINE; + if not Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved',True) then + RaiseLastOSError; + Reg.WriteString(GUIDs,LibraryName); + Reg.CloseKey; finally Reg.Free; end; + SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST,nil,nil); {$IFDEF UnInstallMsgBox} MessageBox(0,'Installation successful.',Libraryname+' '+VersionStr,0); *************** *** 422,436 **** else s:=RegKeys[i]; if Reg.DeleteKey(s) then Inc(RemoveCount); end; finally - Reg.CloseKey; Reg.Free; end; {$IFDEF UnInstallMsgBox} MessageBox(0,PChar( ! IntToStr(RemoveCount)+' keys have been removed from the registry. '+ ! 'Please remove files manually.'), Libraryname+' '+VersionStr,0 ); --- 435,459 ---- else s:=RegKeys[i]; + if Reg.DeleteKey(s) then Inc(RemoveCount); + + // For Windows NT and above, remove oneself from the list of + // approved shell extensions. + Reg.RootKey:=HKEY_LOCAL_MACHINE; + if not Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved',True) then + RaiseLastOSError; + if Reg.DeleteValue(GUIDs) then + Inc(RemoveCount); + Reg.CloseKey; end; finally Reg.Free; end; + SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST,nil,nil); {$IFDEF UnInstallMsgBox} MessageBox(0,PChar( ! IntToStr(RemoveCount)+' entries have been removed from the registry. '+ ! 'Please remove any files manually.'), Libraryname+' '+VersionStr,0 ); |