Исходный код версии 2.0
This commit is contained in:
2022-05-04 07:31:33 +03:00
parent 977c4a728b
commit c585c2f0cb
1423 changed files with 593425 additions and 0 deletions

View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="127"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="1">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_skins.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="128"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="129"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="129"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="129"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="3">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Lin64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Lin64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Lin64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
<Other>
<ConfigFile>
<StopAfterErrCount Value="2"/>
</ConfigFile>
</Other>
</CompilerOptions>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="129"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/eject"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="-h"/>
</local>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="-h"/>
</local>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="80"/>
<BuildNr Value="200"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 RC"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="/close"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="5">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\shared_units\cde_kernel.pas"/>
<IsPartOfProject Value="True"/>
</Unit4>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="-h"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="ANBSTCP"/>
</Item1>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="-h"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<CommandLineParams Value="-h"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="125"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CD Ejecter"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<RevisionNr Value="65"/>
<BuildNr Value="126"/>
<Language Value="0419"/>
<StringTable Comments="(c) 2011 - 2017 by Alexander Babaev." CompanyName="Alexander Babaev" FileDescription="CD Ejecter Command - Line Tool" InternalName="CD Ejecter" LegalCopyright="Alexander Babaev" LegalTrademarks="Alexander Babaev" OriginalFilename="CD Ejecter" ProductName="CD Ejecter" ProductVersion="2.0 beta 1"/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Win32" Default="True"/>
<Item2 Name="Win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win64\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win64"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="ANBSTCP"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="cdejecter.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\shared_units\cde_lang.pas"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\shared_units\cde_dir.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\shared_units\cde_types.pas"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\installed\Win32\bin\cdejecter"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\shared_units"/>
<UnitOutputDirectory Value="data\lib\Win32"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
<OptimizationLevel Value="4"/>
</Optimizations>
<SmallerCode Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,64 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var
ErrorMsg: String;
begin
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <>'' then begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn('DEMO!');
writeln('Usage: ', ExeName, ' -h');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,145 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if not EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** ' + GetLocalizedString(cde_version) + ' 1.2 ***************************');
WriteLn('******* ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
cde_lang, dynlibs, cde_types, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** ' + GetLocalizedString(cde_version) + ' 1.2 ***************************');
WriteLn('******* ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** ' + GetLocalizedString(cde_version) + ' 1.2 ***************************');
WriteLn('******* ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** ' + GetLocalizedString(cde_version) + ' 1.2 ***************************');
WriteLn('******* ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,164 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** ' + GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde') + '***************************');
WriteLn('******* ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' **********');
WriteLn('--------------------------------------------------------------------');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,63 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var ErrorMsg: String;
begin
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <> '' then begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn('DEMO!');
writeln('Использование: ', ExeName, ' -h');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,163 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('[*][*][*] CD Ejecter [*][*][*]');
WriteLn('[*] ' + GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde') + '[*]');
WriteLn('[*] ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' [*]');
WriteLn('');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,163 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
WriteLn('[#] CD Ejecter [#]');
WriteLn('[#] ' + GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde') + '[#]');
WriteLn('[#] ' + FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']) + ' [#]');
WriteLn('');
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,184 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
var StrT, StrV, StrC, StrABL, S1, S2: String;
MaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= 0;
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn('[#] CD Ejecter [#]');
WriteLn('[#] ' + {ver} + '[#]');
WriteLn('[#] ' + {copy} + ' [#]');
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,201 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to hMaxLength - hLen - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(StrT)) + 1 to MaxLength;
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= 0;
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, ASymbol);
WriteWord(StrV, hMaxLength, ASymbol);
WriteWord(StrC, hMaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,201 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to hMaxLength - hLen - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(AWord)) + 1 to AMaxLength;
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= 0;
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,201 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to hMaxLength - hLen - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= 0;
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,201 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= 0;
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,200 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,202 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (Length(S1) + Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= Length(StrT);
if Length(StrV) > MaxLength then
MaxLength:= Length(StrV);
if Length(StrC) > MaxLength then
MaxLength:= Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
WriteLn(IntToStr(MaxLength));
WriteLn(IntToStr(hMaxLength));
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,202 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LCLProc;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
WriteLn(IntToStr(MaxLength));
WriteLn(IntToStr(hMaxLength));
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,61 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var ErrorMsg: String;
begin
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <> '' then begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn('DEMO!');
writeln('Использование: ', ExeName, ' -h');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,202 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 1 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
WriteLn(IntToStr(MaxLength));
WriteLn(IntToStr(hMaxLength));
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,202 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
WriteLn(IntToStr(MaxLength));
WriteLn(IntToStr(hMaxLength));
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,200 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary('cdejecter.dll');
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary('cdejecter.dll');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,200 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,221 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
if not HasParam('silent') then
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,216 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,215 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,217 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
//DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,222 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
//DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,222 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
//DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
//DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,67 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var ErrorMsg: String;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <> '' then
begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then
begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn('DEMO!');
writeln('Использование: ', ExeName, ' -h');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,223 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function GetDiscInf
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,228 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function GetDriveState (const ADisc: WideChar): TDiscState;
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function GetDriveState (const ADisc: WideChar): TDiscState;
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,239 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function GetDriveState (const ADisc: WideChar): TDiscState;
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.GetDriveState (const ADisc: WideChar): TDiscState;
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,244 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.GetDriveState (const ADisc: String): TDiscState;
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,244 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,249 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
begin
WriteLn(GetLocalizedString(cde_messages_errornoparameters));
Abort;
end;
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,249 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,254 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,266 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,266 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,66 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var ErrorMsg: String;
begin
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2 ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <> '' then
begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then
begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn();
writeln(FormatStr(GetLocalizedString(cde_messages_syntax_message), ['$newline$'], [#13#10]));
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,269 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,267 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,265 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
DS: TDiscState;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,270 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(GetLocalizedString(cde_messages_statetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
FreeLibrary(DLL);
case DS of
dsNormal: WriteLn('normal');
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,274 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo;
dsEmpty: WriteLn('empty');
dsUnFormatted: WriteLn('unformatted');
dsNIL: WriteLn('nil');
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,276 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(ADisc);
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,276 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]);
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,276 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,312 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetALLDriveState;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('stateall') then
begin
isHandled:= True;
GetALLDriveState;
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetALLDriveState;
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

View File

@@ -0,0 +1,323 @@
program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
dynlibs, LazUTF8Classes, cde_dir, cde_lang, cde_types, ParamsMngr, cde_kernel, LazUTF8;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); OVERRIDE;
destructor Destroy; OVERRIDE;
procedure WriteHelp; VIRTUAL;
procedure ListDiscs (const Extendend: Boolean);
function CheckIFEmpty (const ADisc: String): Boolean;
procedure GetALLDriveState;
procedure GetDriveState (const ADisc: String);
function FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
procedure ShowDiscInfo (const ADisc: String);
procedure EjectDisc (const ADisc: String);
procedure CloseDisc (const ADisc: String);
procedure BuildTitle;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var isHandled: Boolean;
begin
BuildTitle;
isHandled:= False;
if HasParam('list') then
begin
isHandled:= True;
ListDiscs(False);
end;
if HasParam('listex') then
begin
isHandled:= True;
ListDiscs(True);
end;
if HasParam('stateall') then
begin
isHandled:= True;
GetALLDriveState;
end;
if HasParam('state') then
begin
isHandled:= True;
GetDriveState(GetParamValue('state'));
end;
if HasParam('info') then
begin
isHandled:= True;
ShowDiscInfo(GetParamValue('info'));
end;
if HasParam('eject') then
begin
isHandled:= True;
EjectDisc(GetParamValue('eject'));
end;
if HasParam('close') then
begin
isHandled:= True;
CloseDisc(GetParamValue('close'));
end;
if not isHandled then
WriteHelp;
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
writeln(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
procedure TCDEjecter.ListDiscs (const Extendend: Boolean);
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
SL: TStringListUTF8;
Msg: String;
Indx: Integer;
DInfo: TDiscInfo;
begin
Msg:= '';
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
begin
DInfo:= GetVolumeInfo(WideChar(SL[Indx][1]));
if not (Trim(Msg) = '') then
Msg:= Msg + #13#10;
Msg:= Msg + SL[Indx];
if Extendend then
if DInfo.diHasInfo then
Msg:= Msg + ' - ' + DInfo.diVolumeName
else
Msg:= Msg + ' - ' + GetLocalizedString(cde_messages_nodiscorempty);
end;
FreeLibrary(DLL);
SL.Free;
WriteLn(GetLocalizedString(cde_messages_discslist));
WriteLn(Msg);
end;
function TCDEjecter.CheckIFEmpty (const ADisc: String): Boolean;
begin
Result:= False;
if Trim(ADisc) = '' then
WriteLn(GetLocalizedString(cde_messages_errornoparameters))
else
Result:= True;
end;
procedure TCDEjecter.GetALLDriveState;
procedure WriteDiscState (const ADLL: TLibHandle; const ADisc: WideChar);
var GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc;
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(ADisc);
Msg:= GetLocalizedString(cde_messages_statealltext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(ADisc);
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
var DLL: TLibHandle;
GetCDDiscs: function: PChar;
SL: TStringListUTF8;
Indx: Integer;
begin
WriteLn(GetLocalizedString(cde_messages_statealltitle));
SL:= TStringListUTF8.Create;
DLL:= SafeLoadLibrary(CDELib);
GetCDDiscs:= GetProcAddress(DLL, 'GetCDDiscs');
SL.Delimiter:= ';';
SL.DelimitedText:= GetCDDiscs;
if SL.Count > 0 then
for Indx:= 0 to SL.Count - 1 do
WriteDiscState(DLL, WideChar(SL[Indx][1]));
FreeLibrary(DLL);
FreeAndNil(SL);
end;
procedure TCDEjecter.GetDriveState (const ADisc: String);
var DLL: TLibHandle;
GetDiscState: function (const ADisc: WideChar): TDiscState;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
DS: TDiscState;
begin
DInfo.diDrive:= ADisc[1];
WriteLn(FormatDiscInfo(GetLocalizedString(cde_messages_statetitle), DInfo));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetDiscState:= GetProcAddress(DLL, 'GetDiscState');
DS:= GetDiscState(WideChar(ADisc[1]));
Msg:= GetLocalizedString(cde_messages_statetext);
case DS of
dsNormal: begin
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
Msg:= Msg + GetLocalizedString(cde_discstate_normal);
end;
dsEmpty: Msg:= Msg + GetLocalizedString(cde_discstate_empty);
dsUnFormatted: Msg:= Msg + GetLocalizedString(cde_discstate_unformatted);
dsNIL: Msg:= Msg + GetLocalizedString(cde_discstate_nil);
end;
FreeLibrary(DLL);
WriteLn(FormatDiscInfo(Msg, DInfo));
end;
end;
function TCDEjecter.FormatDiscInfo (const AString: String; const AInfo: TDiscInfo): String;
begin
Result:= FormatStr(AString,
['$newline$',
'$letter$',
'$volumename$',
'$filesystem$',
'$serial$'
],
[#13#10,
AInfo.diDrive,
AInfo.diVolumeName,
AInfo.diFileSystem,
IntToStr(AInfo.diSerial)
]);
end;
procedure TCDEjecter.ShowDiscInfo (const ADisc: String);
var DLL: TLibHandle;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
FreeLibrary(DLL);
if DInfo.diHasInfo then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesc), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_discdesconerror), DInfo);
WriteLn(GetLocalizedString(cde_messages_discinfo));
WriteLn(Msg);
end;
end;
procedure TCDEjecter.EjectDisc (const ADisc: String);
var DLL: TLibHandle;
EjectCD: function (const ADisc: WideChar): Boolean;
GetVolumeInfo: function (const ADisc: WideChar): TDiscInfo;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_ejecttitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
GetVolumeInfo:= GetProcAddress(DLL, 'GetVolumeInfo');
EjectCD:= GetProcAddress(DLL, 'EjectCD');
DInfo.diDrive:= ADisc[1];
DInfo.diVolumeName:= ADisc;
DInfo:= GetVolumeInfo(WideChar(ADisc[1]));
if EjectCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejectsuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_ejecterror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.CloseDisc (const ADisc: String);
var DLL: TLibHandle;
CloseCD: function (const ADisc: WideChar): Boolean;
Msg: String;
DInfo: TDiscInfo;
begin
WriteLn(GetLocalizedString(cde_messages_closetitle));
if CheckIFEmpty(ADisc) then
begin
DLL:= SafeLoadLibrary(CDELib);
CloseCD:= GetProcAddress(DLL, 'CloseCD');
DInfo.diDrive:= ADisc[1];
if CloseCD (WideChar(ADisc[1])) then
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closesuccess), DInfo)
else
Msg:= FormatDiscInfo(GetLocalizedString(cde_messages_closeerror), DInfo);
FreeLibrary(DLL);
WriteLn(Msg);
end;
end;
procedure TCDEjecter.BuildTitle;
procedure WriteWord (const AWord: String; const hMaxLength, AMaxLength: Byte; const ASymbol: Char);
var S1, S2: String;
Indx, hLen: Byte;
begin
hLen:= UTF8Length(AWord) div 2;
S1:= '';
for Indx:= 1 to (hMaxLength - hLen) - 1 do
S1:= S1 + ASymbol;
S1:= S1 + ' ';
S2:= ' ';
for Indx:= (UTF8Length(S1) + UTF8Length(AWord)) + 2 to AMaxLength do
S2:= S2 + ASymbol;
WriteLn(S1 + AWord + S2);
end;
var StrT, StrV, StrC, StrABL: String;
MaxLength, hMaxLength, Indx: Byte;
const ASymbol: Char = '#';
begin
StrT:= 'CD Ejecter';
StrV:= GetLocalizedString(cde_version) + ' ' + GetCDEVerStr('cde');
StrC:= FormatStr(GetLocalizedString(cde_copyrights), ['$DEVYEARS$'], ['2011 - 2017']);
MaxLength:= UTF8Length(StrT);
if UTF8Length(StrV) > MaxLength then
MaxLength:= UTF8Length(StrV);
if UTF8Length(StrC) > MaxLength then
MaxLength:= UTF8Length(StrC);
MaxLength:= MaxLength + 8;
hMaxLength:= MaxLength div 2;
StrABL:= '';
for Indx:= 1 to MaxLength do
StrABL:= StrABL + ASymbol;
WriteLn(StrABL);
WriteWord(StrT, hMaxLength, MaxLength, ASymbol);
WriteWord(StrV, hMaxLength, MaxLength, ASymbol);
WriteWord(StrC, hMaxLength, MaxLength, ASymbol);
WriteLn(StrABL);
WriteLn('');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.

Some files were not shown because too many files have changed in this diff Show More