mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-03 07:29:41 +02:00
Search for cwsdpmi DOS exeutable in PATH if DOSBOX_NEEDS_CWSDPMI is set or TEST_OS_TARGET is go32v2 to allow testing go32v2 programs using DOSBOX
git-svn-id: trunk@36726 -
This commit is contained in:
parent
82569975c6
commit
1c4d1d2327
@ -9,6 +9,8 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
use_temp_dir : boolean = true;
|
use_temp_dir : boolean = true;
|
||||||
|
need_cwsdpmi : boolean = false;
|
||||||
|
cwsdpmi_file : string = '';
|
||||||
hide_execution : boolean = true;
|
hide_execution : boolean = true;
|
||||||
do_exit : boolean = true;
|
do_exit : boolean = true;
|
||||||
verbose : boolean = false;
|
verbose : boolean = false;
|
||||||
@ -232,6 +234,7 @@ begin
|
|||||||
DeleteIfExists(ADosBoxDir + 'dosbox.conf');
|
DeleteIfExists(ADosBoxDir + 'dosbox.conf');
|
||||||
DeleteIfExists(ADosBoxDir + 'EXITCODE.TXT');
|
DeleteIfExists(ADosBoxDir + 'EXITCODE.TXT');
|
||||||
DeleteIfExists(ADosBoxDir + 'EXITCODE.EXE');
|
DeleteIfExists(ADosBoxDir + 'EXITCODE.EXE');
|
||||||
|
DeleteIfExists(ADosBoxDir + 'CWSDPMI.EXE');
|
||||||
DeleteIfExists(ADosBoxDir + 'TEST.EXE');
|
DeleteIfExists(ADosBoxDir + 'TEST.EXE');
|
||||||
RmDir(ADosBoxDir);
|
RmDir(ADosBoxDir);
|
||||||
end;
|
end;
|
||||||
@ -297,6 +300,12 @@ begin
|
|||||||
verbose:=true;
|
verbose:=true;
|
||||||
Writeln('verbose set to true');
|
Writeln('verbose set to true');
|
||||||
end;
|
end;
|
||||||
|
if (GetEnvironmentVariable('DOSBOX_NEEDS_CWSDPMI')<>'') or
|
||||||
|
(GetEnvironmentVariable('TEST_OS_TARGET')='go32v2') then
|
||||||
|
begin
|
||||||
|
need_cwsdpmi:=true;
|
||||||
|
Writeln('need_cwsdpmi set to true');
|
||||||
|
end;
|
||||||
if GetEnvironmentVariable('DOSBOX_TIMEOUT')<>'' then
|
if GetEnvironmentVariable('DOSBOX_TIMEOUT')<>'' then
|
||||||
begin
|
begin
|
||||||
dosbox_timeout:=StrToInt(GetEnvironmentVariable('DOSBOX_TIMEOUT'));
|
dosbox_timeout:=StrToInt(GetEnvironmentVariable('DOSBOX_TIMEOUT'));
|
||||||
@ -344,6 +353,14 @@ begin
|
|||||||
GenerateDosBoxConf(DosBoxDir);
|
GenerateDosBoxConf(DosBoxDir);
|
||||||
CopyFile(ExtractFilePath(ParamStr(0)) + 'exitcode.exe', DosBoxDir + 'EXITCODE.EXE');
|
CopyFile(ExtractFilePath(ParamStr(0)) + 'exitcode.exe', DosBoxDir + 'EXITCODE.EXE');
|
||||||
CopyFile(ParamStr(1), DosBoxDir + 'TEST.EXE');
|
CopyFile(ParamStr(1), DosBoxDir + 'TEST.EXE');
|
||||||
|
if need_cwsdpmi then
|
||||||
|
begin
|
||||||
|
cwsdpmi_file:=FileSearch('cwsdpmi.exe',GetEnvironmentVariable('PATH'));
|
||||||
|
if cwsdpmi_file<>'' then
|
||||||
|
CopyFile(cwsdpmi_file, DosBoxDir + 'CWSDPMI.EXE')
|
||||||
|
else if verbose then
|
||||||
|
writeln('cwsdpmi executable missing');
|
||||||
|
end;
|
||||||
ExecuteDosBox(DosBoxBinaryPath, DosBoxDir);
|
ExecuteDosBox(DosBoxBinaryPath, DosBoxDir);
|
||||||
finally
|
finally
|
||||||
ExitProc;
|
ExitProc;
|
||||||
|
Loading…
Reference in New Issue
Block a user