Skip to content

Commit

Permalink
Unportable version
Browse files Browse the repository at this point in the history
From now if You need a portable version  then add -dPortable compiler key
  • Loading branch information
Al-Muhandis committed Aug 27, 2021
1 parent 0ef82b5 commit 70e69a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*.bat
*.new

tgshd

# Lazarus autogenerated files (duplicated info)
*.rst
*.rsj
Expand All @@ -36,4 +34,11 @@ backup/
lib/

# Application bundle for Mac OS
*.app/
*.app/

# Output binary folders
x86_64-linux/

# Binary
tests/console
tgshd
6 changes: 4 additions & 2 deletions configuration.pas
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ destructor TConfig.Destroy;
inherited Destroy;
end;

initialization
initialization{$ifdef portable}
CnfDir:=IncludeTrailingPathDelimiter(ExtractFileDir(ParamStr(0)));
Cnfg:=TConfig.Create(CnfDir+ChangeFileExt(ExtractFileName(ParamStr(0)), '.ini'));
Cnfg:=TConfig.Create(CnfDir+ChangeFileExt(ExtractFileName(ParamStr(0)), '.ini'));{$else}
CnfDir:=GetAppConfigDir(True);
Cnfg:=TConfig.Create(CnfDir+ChangeFileExt(ExtractFileName(ParamStr(0)), '.ini'));{$endif}

finalization
FreeAndNil(Cnfg);
Expand Down
6 changes: 3 additions & 3 deletions tgshd.lpi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="Telegram shell daemon"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
Expand All @@ -19,7 +19,7 @@
<MajorVersionNr Value="1"/>
<MinorVersionNr Value="1"/>
<RevisionNr Value="1"/>
<BuildNr Value="3"/>
<BuildNr Value="5"/>
</VersionInfo>
<BuildModes Count="4">
<Item1 Name="Default" Default="True"/>
Expand Down

0 comments on commit 70e69a3

Please sign in to comment.