Posted 15 July 2003 - 14:06
Das war der entscheidende Hint !
Hab das jetzt so gelöst:
function OnAppSearch()
STRING szKey, szName, szSubKey, szSubKey1, szNumName, svValue, svResult, szDelimiterSet, svSring;
STRING svPath , svFile, svString, svUninstall, svUninstallPath, svProgram, svCommand, szProg;
NUMBER nvSize, nResult, nResult2, nReturn1, nItem, nReturn, nvType, nvAktivTCL, nvTCL;
#define KEY "\\ActiveTclScript\\shell\\open\\command";
#define KEY1 "\\TclScript\\shell\\open\\command"
LIST listID, listUninstProg, listUninstall ;
begin
listID = ListCreate ( STRINGLIST );
szSubKey = KEY;
szSubKey1 = KEY1;
if (RegDBKeyExist(szSubKey) = 1) then
RegDBGetKeyValueEx(szSubKey, szNumName, nvType, svValue , nvSize);
szDelimiterSet = " \"";
StrGetTokens(listID, svValue, szDelimiterSet);
ListGetFirstString (listID, svString);
ParsePath ( svPath , svString , PATH );
ParsePath ( svFile , svString , FILENAME );
if (FindFile ( svPath , svFile , svResult ) =0) then
nvAktivTCL = 1;
else
// Registry Leiche
nvAktivTCL = 0;
endif;
ListDestroy ( listID );
endif;
if (RegDBKeyExist(szSubKey1) = 1) then
// Schau ma mal nach dem alten TCL.
RegDBGetKeyValueEx(szSubKey1, szNumName, nvType, svValue , nvSize);
szDelimiterSet = " \"";
StrGetTokens(listID, svValue, szDelimiterSet);
ListGetFirstString (listID, svString);
ParsePath ( svPath , svString , PATH );
ParsePath ( svFile , svString , FILENAME );
ListDestroy ( listID );
if (FindFile ( svPath , svFile , svResult ) =0) then
// Altes Tcl Deinstallieren
listUninstall = ListCreate (STRINGLIST);
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
svUninstall = "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
nItem = REGDB_KEYS;
nReturn = RegDBQueryKey(svUninstall, nItem, listUninstall);
nResult2 = ListGetFirstString(listUninstall, szProg);
while (nResult2 = 0)
// Abfrage des Unterschlüssels
if (szProg % "Tcl/Tk") then
nvType = REGDB_STRING_EXPAND;
szKey = svUninstall +"\\"+szProg;
szNumName = "UninstallString";
RegDBGetKeyValueEx(szKey, szNumName, nvType, svUninstallPath, nvSize);
szDelimiterSet = " ";
listUninstProg = ListCreate (STRINGLIST);
StrGetTokens(listUninstProg, svUninstallPath, szDelimiterSet);
ListGetFirstString(listUninstProg, svProgram);
ListGetNextString(listUninstProg, svCommand);
LaunchAppAndWait ( svProgram , svCommand , WAIT );
ListDestroy ( listUninstProg );
endif;
nResult2 = ListGetNextString (listUninstall, szProg);
endwhile;
endif;
ListDestroy ( listUninstall );
endif;