program TFDinoInstaller; 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. Aborting.') else if (rnpath<>'0') and (rnpath<>ccpath) then writeln('TFD Renegade is installed. Aborting.') else begin writeln('Adjusting registry...'); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_folder /t REG_SZ /d "',ccpath,'" /f >nul')); swapvectors; Exec(GetEnv('COMSPEC'),'/C reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_executable /t REG_SZ /d "C&C95.exe" /f >nul'); swapvectors; Exec(GetEnv('COMSPEC'),'/C reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Command and Conquer The First Decade" /v rn_args /t REG_SZ /d "-cd. funpark" /f >nul'); swapvectors; writeln(); writeln('Adding files...'); Exec(GetEnv('COMSPEC'),'/C if not exist dino1.dat echo data file "dino1.dat" not found!'); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino1.dat copy dino1.dat "',ccpath,'\wwconfig.exe" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),'/C if not exist dino2.dat echo data file "dino2.dat" not found!'); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino2.dat if exist "',tfdpath,'\!b05_hover.bmp" del "',tfdpath,'\b05_hover.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino2.dat if exist "',tfdpath,'\b05_hover.bmp" move "',tfdpath,'\b05_hover.bmp" "',tfdpath,'\!b05_hover.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino2.dat copy dino2.dat "',tfdpath,'\b05_hover.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),'/C if not exist dino3.dat echo data file "dino3.dat" not found!'); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino3.dat if exist "',tfdpath,'\!b05_idle.bmp" del "',tfdpath,'\b05_idle.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino3.dat if exist "',tfdpath,'\b05_idle.bmp" move "',tfdpath,'\b05_idle.bmp" "',tfdpath,'\!b05_idle.bmp" >nul')); swapvectors; Exec(GetEnv('COMSPEC'),concat('/C if exist dino3.dat copy dino3.dat "',tfdpath,'\b05_idle.bmp" >nul')); swapvectors; end; writeln(); writeln(); writeln(); writeln(); cntin; end.