program TFDinoUninstaller; uses crt, dos, windows; var gamename:string[2]; ccpath, rnpath, tfdpath:string[200]; procedure cntin; var pause: char; begin writeln; writeln('Press any key to continue.'); repeat until keypressed; pause:=ReadKey(); end; {cntin} function regpath (var game: string):string[200]; var path: string[200]; key : HKEY; ptha : array[1..200] of char; s: string; bl, ret : DWORD; teller:integer; begin s:=concat(game,'_folder'); bl:=200; path:=''; RegOpenKeyEx( HKEY_LOCAL_MACHINE, 'SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade', 0, KEY_QUERY_VALUE, key ); ret := RegQueryValueEx( key, @s[1], nil, nil, @ptha, @bl); for teller:=1 to (bl-1) do path:=concat(path,ptha[teller]); RegCloseKey( key ); if ret<>0 then regpath:='0' else if path = '' then regpath:='0' else regpath:=path; end; {regpath} begin gamename:='cc'; ccpath:=regpath(gamename); gamename:='rn'; rnpath:=regpath(gamename); tfdpath:=concat(copy(ccpath,1,(length(ccpath)-21)),'Launcher'); if ccpath='0' then writeln('TFD Command & Conquer is not installed.') else if (rnpath<>'0') and (rnpath<>ccpath) then writeln('TFD Renegade is installed.') else if rnpath='0' then writeln('Dino mod is not installed.') else begin writeln('Adjusting registry...'); swapvectors; Exec(GetEnv('COMSPEC'),'/C reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_folder /f >nul'); swapvectors; Exec(GetEnv('COMSPEC'),'/C reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_executable /f >nul'); swapvectors; Exec(GetEnv('COMSPEC'),'/C reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_args /f >nul'); swapvectors; end; writeln(); writeln('Checking for backup files to restore...'); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist "',ccpath,'\wwconfig.exe" del "',ccpath,'\wwconfig.exe"')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist "',tfdpath,'\!b05_hover.bmp" del "',tfdpath,'\b05_hover.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist "',tfdpath,'\!b05_hover.bmp" move "',tfdpath,'\!b05_hover.bmp" "',tfdpath,'\b05_hover.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist "',tfdpath,'\!b05_idle.bmp" del "',tfdpath,'\b05_idle.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist "',tfdpath,'\!b05_idle.bmp" move "',tfdpath,'\!b05_idle.bmp" "',tfdpath,'\b05_idle.bmp" >nul')); swapvectors; writeln('Done.'); cntin; end.