1 { This file is part of WineLauncher.
3 WineLauncher is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, version 3 of the License.
7 WineLauncher is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with WineLauncher. If not, see <http://www.gnu.org/licenses/>.
23 Classes
, SysUtils
, XMLCfg
, strutils
, BaseUnix
, Process
, StdCtrls
, FileUtil
, Graphics
;
25 procedure Log(Level
:integer; Channel
:string; LogText
:string);
27 procedure LogVar(MyVar
:string; MyVarName
:string);
29 procedure SaveLastUsedConfig();
30 procedure LoadLastUsedConfig();
31 procedure RunWineCheck(ProgramNameOverRide
:string; ProgramFlagsOverRide
:string);
33 function Wrap(Input
:string):string; { Makes Paths look better, E.G. " ( Input ) " }
34 function WinToUnixPath(Path
:string):string;
35 function UnixToWinPath(Path
:string; DriveChar
:Char):string;
36 function GetUnixDirPath(FilePath
:string):string;
37 function FileExistsAndIsExecutable(FullPath
:string; JustCheckExists
:boolean): boolean ;
38 function WorkDirTemplate(FolderPath
:string):string;
39 function DoesFolderExists(Path
:string; FolderName
:string): boolean;
40 function DoesFoldersExists(Path
:string; FolderNames
:Tstrings
): boolean;
41 function DirExistsIfNotMakeIt(Path
:string; FolderName
:string ): boolean;
42 function DirExistsIfNotMakeIt(PathWithFolder
:string): boolean;
43 function CheckPaths():boolean;
44 function SetupGit():boolean;
45 function MakeFile(FullPath
:string;Data
:string):boolean;
46 function SetExecutableFlag(FullPath
:string):boolean;
47 function ListProgramsOnDisc(ModeMe
:TStrings
; DriveChar
:char):boolean;
48 function ColourCheck(Input
: TEdit
):boolean;
49 function CutUpFlags(Flags
:string):boolean;
52 XmlLastUsedConfig
:TXMLConfig
;
54 LastReadLinkPath
:string;
55 DiscErrorText
:string; {Used for the reporting errors in 'ListProgramsOnDisc'.}
59 uses UnitMain
, UnitSettings
, UnitProgramsList
;
62 function FileExistsAndIsExecutable(FullPath
:string; JustCheckExists
:boolean): boolean ;
66 ChannelLocal
:= ('FileExistsAndIsExecutable');
68 if JustCheckExists
= true then
70 if FileExists(FullPath
) then
73 if JustCheckExists
= true then Log(3, ChannelLocal
, 'File' + Wrap(FullPath
) + 'exists.');
79 Log(4, ChannelLocal
,'File' + Wrap(FullPath
) + 'does not exists.');
85 if FpAccess(FullPath
, X_OK
{Exe flag check}) <> 0 then
87 Log(4, ChannelLocal
,'File' + Wrap(FullPath
) + 'is not executable.');
93 Log(3, ChannelLocal
,'File' + Wrap(FullPath
) + 'is executable.');
101 function Wrap(Input
: string):string;
103 Result
:= ( ' ( ' + Input
+ ' ) ' );
106 function DoesFoldersExists(Path
:string; FolderNames
:Tstrings
): boolean;
111 { Take a path and check to see if the listed folders exists in that path. }
112 { TODO : Add a way to check the result from each one and return it. }
113 for loop
:= 0 to ( FolderNames
.Count
- 1 ) do
115 if DoesFolderExists(Path
, FolderNames
[loop
]) = false then
123 function DoesFolderExists(Path
:string; FolderName
:string): boolean;
127 ChannelLocal
:= 'DoesFolderExists';
128 if DirectoryExists(Path
+ FolderName
) = true then
132 UnitMain
.form1
.LogWithDebug(3, ChannelLocal
, ('Folder' + Wrap(Path
+ FolderName
) + 'exists.'));
138 Log(4, ChannelLocal
, ('Folder' + Wrap(Path
+ FolderName
) + 'does not exists.'));
142 procedure Log(Level
:integer;Channel
:string;LogText
:string);
149 if AllFine
= true then
155 {Level 4 "Dev-Error"}
156 {Level 5 is for uses with custom functions.}
159 LevelString
:= 'Info';
164 LevelString
:= 'Error';
169 LevelString
:= 'Variable';
174 LevelString
:= 'Dev-Info';
179 LevelString
:= 'Dev-Error';
185 UnitMain
.form1
.Memo_LogOutPut
.Lines
.Add(LogText
);
193 if HideChannel
= true then
195 WriteLn(LevelString
+ ': ' + LogText
);
196 UnitMain
.form1
.Memo_LogOutPut
.Lines
.Add(LevelString
+ ': ' + LogText
);
200 WriteLn(LevelString
+ ':' + Channel
+ ': ' + LogText
);
201 UnitMain
.form1
.Memo_LogOutPut
.Lines
.Add(LevelString
+ ':' + Channel
+ ': ' + LogText
);
209 procedure SaveLastUsedConfig();
211 if Loading
= true then exit
;
214 XmlLastUsedConfig
.SetValue('Version', '2');
215 XmlLastUsedConfig
.SetValue('WineVersionInfo/DistributionName', UnitMain
.form1
.ComboBox_DistributionName
.Text );
216 XmlLastUsedConfig
.SetValue('WineVersionInfo/DistributionVersion', UnitMain
.form1
.ComboBox_DistributionVersion
.Text );
217 XmlLastUsedConfig
.SetValue('WineVersionInfo/Architecture', UnitMain
.form1
.ComboBox_Architecture
.Text );
218 XmlLastUsedConfig
.SetValue('WineVersionInfo/WineVersion', UnitMain
.form1
.ComboBox_WineVersion
.Text );
220 XmlLastUsedConfig
.SetValue('WineVersionInfo/UsesTerminal', UnitMain
.form1
.Check_Terminal
.Checked
);
221 XmlLastUsedConfig
.SetValue('WineVersionInfo/UsesSoundWrapper', UnitMain
.form1
.CheckBox_UseSoundWrapper
.Checked
);
224 XmlLastUsedConfig
.Filename
:= ( ConfigPath
+ '/LastUsedConfig.xml' );
227 XmlLastUsedConfig
.Flush
;
232 procedure LoadLastUsedConfig();
234 LastUsedConfigVersion
:string;
237 XmlLastUsedConfig
:= TXMLConfig
.Create(nil);
240 XmlLastUsedConfig
.Filename
:= ( ConfigPath
+ '/LastUsedConfig.xml' );
242 { Version of Settings }
243 LastUsedConfigVersion
:= XmlLastUsedConfig
.GetValue('Version','');
245 LogVar(LastUsedConfigVersion
,'LastUsedConfigVersion');
248 { Make sure we can read the file. }
249 if LastUsedConfigVersion
= '-1' then
251 Log(3, Channel
, 'Invalided file version, Never mind we ignore it and wirte over it.');
255 UnitMain
.form1
.ComboBox_DistributionName
.Text := XmlLastUsedConfig
.GetValue('WineVersionInfo/DistributionName', '' );
256 UnitMain
.form1
.ComboBox_DistributionVersion
.Text := XmlLastUsedConfig
.GetValue('WineVersionInfo/DistributionVersion', '' );
257 UnitMain
.form1
.ComboBox_Architecture
.Text := XmlLastUsedConfig
.GetValue('WineVersionInfo/Architecture', '' );
258 UnitMain
.form1
.ComboBox_WineVersion
.Text := XmlLastUsedConfig
.GetValue('WineVersionInfo/WineVersion', '' );
260 UnitMain
.form1
.Check_Terminal
.Checked
:= XmlLastUsedConfig
.GetValue('WineVersionInfo/UsesTerminal', false );
261 UnitMain
.form1
.CheckBox_UseSoundWrapper
.Checked
:= XmlLastUsedConfig
.GetValue('WineVersionInfo/UsesSoundWrapper', false );
265 XmlLastUsedConfig
.Flush
;
271 function WinToUnixPath(Path
:string):string;
273 PathUpToDosdevices
:string;
274 DriveNameWithSlash
:string;
277 {Get the path up to Dosdevices.}
278 PathUpToDosdevices
:= (GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/prefix/' + UnitMain
.form1
.ComboBox_PreFix
.Text + '/dosdevices/' );
279 {Take the DriveName off 'path' and replace '\' with '/'.}
280 DriveNameWithSlash
:= (AnsiLowerCase( Copy2SymbDel( Path
, '\' )) + '/');
281 {Replace all '\' to '/'.}
282 Path
:= AnsiReplaceText(Path
, '\', '/');
284 FullUnixPath
:= (PathUpToDosdevices
+ DriveNameWithSlash
+ Path
);
286 {$IFDEF MOREDEBUG_WinToUnixPath}
287 logVar(PathUpToDosdevices
, 'PathUpToDosdevices');
288 logVar(DriveNameWithSlash
, 'DriveNameWithSlash');
289 logVar(Path
, 'Path');
291 logVar(FullUnixPath
, 'FullUnixPath');
293 Result
:= FullUnixPath
;
298 function UnixToWinPath(Path
:string; DriveChar
:Char):string;
300 WindowsFilePath
:string;
310 Path
:= AnsiReverseString(Path
);
311 SmallPath
:= Copy2SymbDel(Path
, ':');
312 SmallPath
:= AnsiReverseString(SmallPath
);
313 Cleanup
:= AnsiReplaceText(SmallPath
, '/', '\');
314 WindowsFilePath
:= (DriveChar
+ ':' + Cleanup
);
317 logVar(WindowsFilePath
, 'WindowsFilePath');
319 Result
:= WindowsFilePath
;
323 function GetUnixDirPath(FilePath
:string):string;
326 //LocalChannel:string;
328 DirPath
:= LeftStr(FilePath
, (Rpos('/',FilePath
) ));
329 //log(0, LocalChannel, ( 'VAR ' + DirPath));
334 function WorkDirTemplate(FolderPath
:string):string;
336 Result
:= ('cd "' + FolderPath
+ '";' + #10 );
340 procedure LogVar(MyVar
: string; MyVarName
: string);
342 Log(2, 'LogVar', ( Wrap( MyVarName
) + 'is' + Wrap( MyVar
)) );
346 function CheckPaths():boolean;
351 if DirExistsIfNotMakeIt(GetEnvironmentVariable('HOME'), '/.config') <> true then
356 if DirExistsIfNotMakeIt(ConfigPath
) <> true then
362 if DirExistsIfNotMakeIt(GetEnvironmentVariable('HOME') + '/' , WineUserFolder
) = false then
367 if DirExistsIfNotMakeIt(GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/', 'prefix') = false then
373 if DoesFolderExists(GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/', 'git') = false then
380 if DirExistsIfNotMakeIt(GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/', 'wine') = false then
391 function SetupGit():boolean;
399 Process
:= TProcess
.Create(nil);
401 ChannelLocal
:= 'SetupGit';
403 script
:= '#! /bin/sh' +{linebrake}#10 +
404 'echo This script will fetch Wine and compile it. ;'+{linebrake}#10 +
405 'echo If it fails please install the dependencies and rerun WineLauncher, see http://wiki.winehq.org/Recommended_Packages for more help.' +{linebrake}#10 +
406 'cd ' + GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ ' ;' +{linebrake}#10 +
407 'git clone git://source.winehq.org/git/wine.git git ;' +{linebrake}#10 +
408 'cd ./git ;' +{linebrake}#10 +
409 'git checkout -b stable-1.0.1 wine-1.0.1 ;' +{linebrake}#10 +
410 'Dname=`lsb_release -si` ;' +{linebrake}#10 +
411 'Dversion=`lsb_release -sr` ;' +{linebrake}#10 +
412 'Aname=`uname -m` ;' +{linebrake}#10 +
413 './configure --prefix=' + GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/wine/$Dname/$Dversion/$Aname/stable-1.0.1 ;' +{linebrake}#10 +
414 'make ;' +{linebrake}#10 +
415 'make install;' +{linebrake}#10 +
416 GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/wine/$Dname/$Dversion/$Aname/stable-1.0.1/bin/wineprefixcreate --prefix "' + GetEnvironmentVariable('HOME') + '/' + WineUserFolder
+ '/prefix/default/"' +{linebrake}#10 ;
419 if MakeFile((ConfigPath
+ '/SetupGit'),script
) = true then
422 {Set executable flag}
423 if SetExecutableFlag(ConfigPath
+ '/SetupGit') = false then
428 if FileExistsAndIsExecutable('/usr/bin/gnome-terminal',false) = true then
430 Terminal
:= 'gnome-terminal -x ';
434 if FileExistsAndIsExecutable('/usr/bin/gnome-terminal',false) = true then
436 Terminal
:= '/usr/bin/konsole -x ';
439 if FileExistsAndIsExecutable('/usr/bin/gnome-terminal',false) = true then
441 Terminal
:= '/usr/bin/xterm ';
446 if RunYes
= true then
448 Log(0, ChannelLocal
, 'Script One has being executed.');
449 Process
.CommandLine
:= Terminal
+ ConfigPath
+'/SetupGit';
453 while Process
.Running
= true do
458 Result
:= Process
.WaitOnExit
;
465 function DirExistsIfNotMakeIt(Path
:string; FolderName
:string ): boolean;
467 LocalChannel
:string; {Ignore this for now}
471 if FolderName
<> '' then
473 if DirectoryExists( Path
+ FolderName
) = true then
475 Log(0, LocalChannel
, ('Directory' + Wrap( Path
+ FolderName
) + 'exists.')) ;
480 Log(0, LocalChannel
, ('Directory' + Wrap( Path
+ FolderName
) + ' does not exists.')) ;
481 if CreateDir( Path
+ FolderName
) then
483 Log(0, LocalChannel
, ('File' + Wrap( Path
+ FolderName
) + 'has being created.')) ;
488 Log(0, LocalChannel
, ('File' + Wrap( Path
+ FolderName
) + 'can not be created.')) ;
500 function DirExistsIfNotMakeIt(PathWithFolder
:string): boolean;
505 {E.G. PathWithFolder := '/home/test/hello/'.}
507 {If PathWithfolder has '/' at the end remove it.}
508 RemoveTrailingChars(PathWithFolder
,['/']);
510 {FolderName := 'hello'.}
511 FolderName
:= ExtractFileName(PathWithFolder
);
513 {FolderPath := '/home/test/'.}
514 FolderPath
:= ExtractFilePath(PathWithFolder
);
517 logVar(FolderName
, 'FolderName');
518 logVar(FolderPath
, 'FolderPath');
521 {Pass the data to real function and get the result back.}
522 if DirExistsIfNotMakeIt(FolderPath
, FolderName
) = true then Result
:= true else Result
:= false;
525 function MakeFile(FullPath
:string;Data
:string):boolean;
533 FD1
:= fpOpen (FullPath
, O_WrOnly
or O_Creat
);
536 if length(Data
)<>fpwrite (FD1
,Data
[1],Length(Data
)) then
539 Log(1, CL
, ('When writing to' + Wrap(FullPath
)) );
544 Log(3, CL
, ('File' + Wrap(FullPath
) + 'has being created'));
552 function SetExecutableFlag(FullPath
:string):boolean;
556 {770 is owner rwx, group rwx, other nothing}
557 if fpChmod (FullPath
,&770) <> 0 then {0 = no error}
559 Log(1, ChannelLocal
, ('Can not set executable flag on' + Wrap(FullPath
)) );
565 Log(0, ChannelLocal
, ('Executable flag has being set on' + Wrap(FullPath
)) );
572 function ListProgramsOnDisc(ModeMe
:TStrings
; DriveChar
:char):boolean;
583 Path
:= (GetEnvironmentVariable('HOME') +'/'+ WineUserFolder
+ '/prefix/' + UnitMain
.Form1
.ComboBox_PreFix
.Text + '/dosdevices/' + AnsiLowerCase(DriveChar
));
585 if OldPath
<> Path
then
587 if AsyncProcessScan
.Active
= false then
592 LastReadLinkPath
:= fpReadLink(Path
+ ':');
594 if LastReadLinkPath
= '' then
598 log(4, '',('Link ' + Wrap(Path
+ ':') + 'does not exists.'));
599 LastReadLinkPath
:= '';
600 DiscErrorText
:= 'Please map' + wrap(DriveChar
+ ':') + 'to your cd / dvd drive, You can do that in winecfg.';
606 If FindFirst(Path
+ ':/*',faAnyFile
and faDirectory
,Info
)=0 then
610 Until FindNext(info
)<>0;
613 log(0,'', Info
.Name
);
614 DiscErrorText
:= 'You have no disc in your drive.';
617 LastReadLinkPath
:= '';
625 if LastReadLinkPath
= '/' then
627 DiscErrorText
:= 'You can not map '+ DriveChar
+ ': to root.';
630 LastReadLinkPath
:= '';
636 if LastReadLinkPath
= GetEnvironmentVariable('HOME') then
638 DiscErrorText
:= 'You can not map '+ DriveChar
+ ': to your home folder.';
641 LastReadLinkPath
:= '';
648 script
:= '/usr/bin/find -H ' + Path
+ ': -iname *.exe';
649 Log(0, '', 'Script Scan has being executed.');
650 AsyncProcessScan
.CommandLine
:= script
;
651 AsyncProcessScan
.Execute
;
652 DiscErrorText
:= 'Scaning';
653 Timer
.Enabled
:= true;
661 function ColourCheck(Input
: TEdit
):boolean;
666 LocalChannel
:= 'ColourCheck';
667 {This does a CaseInsensitive check to see if the file exists. Wine does not care about the executable flag. }
668 {I can not find FindDiskFileCaseInsensitive in the doc.}
669 {If it can not find the file it will return nothing and it will clear the string.}
670 temp
:= WinToUnixPath(Input
.Text);
672 if FindDiskFileCaseInsensitive(temp
) <> '' then
674 {$IFDEF MoreTrue}Log(3, LocalChannel
, 'File' + Wrap(temp
) + 'exists.');{$ENDIF}
675 Input
.Font
.Color
:= clgreen
;
680 Log(4, LocalChannel
,'File' + Wrap(Input
.Text) + 'does not exists.');
681 Input
.Font
.Color
:= clred
;
687 procedure RunWineCheck(ProgramNameOverRide
:string; ProgramFlagsOverRide
:string);
693 WinePreFixRaw
:string;
700 UnixPathWithOutFile
:string;
702 ChannelLocal
:= ('RunWineCheck');
705 {Get wine version info}
706 if RunYes
= true then
708 {Check for wine in root}
709 if FileExistsAndIsExecutable( {FullPath:string} WinePath
+ '/wine', {JustCheckExists:boolean}false) = true then
711 wine_version_full
:= (WinePath
+ '/wine');
713 LogVar(wine_version_full
,'wine_version_full');
717 {Check for wine in "/bin/wine"}
718 if FileExistsAndIsExecutable( {FullPath:string} WinePath
+ '/bin/wine', {JustCheckExists:boolean}false) = true then
720 wine_version_full
:= (WinePath
+ '/bin/wine');
722 LogVar(wine_version_full
,'wine_version_full');
727 {Error Can not find wine}
728 Log(0, ChannelLocal
, 'Can not find wine');
734 if RunYes
= true then
736 if UnitMain
.form1
.Check_Terminal
.Checked
= true then
738 if UnitMain
.form1
.ComboBox_TerminalName
.Text <> '' then
740 temp00
:= UnitMain
.form1
.ComboBox_TerminalName
.ItemIndex
;
741 RunIn
:= ( UnitSettings
.Form4
.StringGrid_TerminalSettings
.Cells
[1,temp00
] + ' ' + UnitSettings
.Form4
.StringGrid_TerminalSettings
.Cells
[2,temp00
] );
742 Log(0, ChannelLocal
, ('Using Terminal' + Wrap( RunIn
)) );
747 { TODO : After the TempProgram is closed the child process is still listed. }
748 RunIn
:= UnitSettings
.Form4
.ComboBox_ShellPath
.text;
749 Log(0, ChannelLocal
, ('Using' + Wrap( RunIn
)) );
756 if RunYes
= true then
758 WinePreFixRaw
:= (PreFixList
[1].Strings
[UnitMain
.form1
.ComboBox_PreFix
.ItemIndex
]);
759 WinePreFix
:= ('env WINEPREFIX="' + WinePreFixRaw
+ '"');
761 LogVar(WinePreFix
,'WinePreFix');
766 if RunYes
= true then
768 if UnitMain
.form1
.CheckBox_UseSoundWrapper
.Checked
= true then
770 if FileExists( UnitMain
.form1
.ComboBox_SoundWrapper
.Text ) = true then
772 SoundWrapper
:= UnitMain
.form1
.ComboBox_SoundWrapper
.Text + ' ' ;
773 Log(0, ChannelLocal
, ( 'File' + Wrap( UnitMain
.form1
.ComboBox_SoundWrapper
.Text ) + 'exists'));
778 Log(1, ChannelLocal
, ( 'File' + Wrap( UnitMain
.form1
.ComboBox_SoundWrapper
.Text ) + 'does not exists'));
783 Log(0, ChannelLocal
, ('No sound wrapper will be used'));
787 if ProgramNameOverRide
= '' then
789 if RunYes
= true then
791 if UnitMain
.form1
.EditBox_ProgramPath
.Text <> '' then
794 for loop
:= 0 to ( UnitMain
.form1
.CheckListBox_Flags
.Items
.Count
) do
796 if UnitMain
.form1
.CheckListBox_Flags
.Checked
[loop
] = true then
798 ProgramFlags
:= ( ProgramFlags
+ ' ' + UnitMain
.form1
.CheckListBox_Flags
.Items
.ValueFromIndex
[loop
] );
803 LogVar(ProgramFlags
,'ProgramFlags' );
805 ProgramName
:= ( ' ' + '"' + UnitMain
.form1
.EditBox_ProgramPath
.Text + '"' + ProgramFlags
+ ' ' );
810 Log(1, ChannelLocal
, ('Please select a program.'));
817 ProgramName
:= ( ' ' + '"' + ProgramNameOverRide
+ '"' + ProgramFlagsOverRide
+ ' ' );
821 if RunYes
= true then
823 UnixPathWithOutFile
:= ExtractFilePath(WinToUnixPath(UnitMain
.form1
.EditBox_ProgramPath
.Text));
824 if ProgramNameOverRide
= '' then
826 if DoesFolderExists(ExtractFilePath(UnixPathWithOutFile
), ExtractFileName(UnixPathWithOutFile
)) then
828 WorkDir
:= WorkDirTemplate( GetUnixDirPath(WinToUnixPath(UnitMain
.form1
.EditBox_ProgramPath
.Text)) );
829 end {DoesFolderExists}
832 WorkDir
:= WorkDirTemplate(WinePreFixRaw
+ '/dosdevices/c:/windows');
833 end; {DoesFolderExists}
834 end {ProgramNameOverRide}
837 WorkDir
:= WorkDirTemplate(WinePreFixRaw
+ '/dosdevices/c:/windows');
838 end; {ProgramNameOverRide}
842 if RunYes
= true then
844 start_S1
:= '#! /bin/sh' + {linebrake}#10 + WorkDir
{linebrake} + WinePreFix
+ SoundWrapper
+ ' ' + wine_version_full
+ ' ' + ProgramName
+ ';' ;
846 LogVar(start_S1
,'start_S1');
851 if RunYes
= true then
853 if MakeFile((ConfigPath
+ '/1'),start_S1
) = false then
858 {Set executable flag}
859 if RunYes
= true then
861 if SetExecutableFlag(ConfigPath
+ '/1') = false then
868 if RunYes
= true then
870 Log(0, ChannelLocal
, ('Script One has being executed.'));
871 AProcess
.CommandLine
:= RunIn
+ ' ' + ConfigPath
+'/1';
872 { TODO : After the TempProgram is closed the child process is still listed. }
877 Log(1, ChannelLocal
, ('Somethings Wrong, check your log'));
882 function CutUpFlags(Flags
:string):boolean;
888 UnitMain
.form1
.CheckListBox_Flags
.Items
.Clear
;
890 for loop
:= 0 to ( WordCount( Flags
, [';'] ) ) do
892 Dump
:= FindPart( ';', Flags
);
893 Temp
:= LeftStr( Flags
, Dump
- 1);
894 if Temp
<> '' then UnitMain
.form1
.CheckListBox_Flags
.Items
.Add(Temp
);
895 Delete(Flags
, 1, (Dump
)) ;
897 if Flags
<> '' then UnitMain
.form1
.CheckListBox_Flags
.Items
.Add(Flags
);