Skip to content

Commit

Permalink
Merge pull request #7 from HashLoad/development
Browse files Browse the repository at this point in the history
Adjusted overflow
  • Loading branch information
snakeice authored Jul 24, 2019
2 parents c389da9 + 599c52d commit 9e4c19c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 0 additions & 2 deletions boss_ide.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k260.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp260.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
Expand Down
18 changes: 12 additions & 6 deletions src/core/Boss.Modules.PackageProcessor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface
TBossPackageProcessor = class
private
FDataFile: TStringList;
FHomeDrive: string;
FHomePath: string;

function GetBplList: TStringDynArray;
function GetBinList(ARootPath: string): TStringDynArray;
Expand Down Expand Up @@ -76,18 +78,16 @@ procedure ExecuteAndWait(const ACommand: string);

function TBossPackageProcessor.GetEnv(AEnv: string): string;
begin
Result := GetEnvironmentVariable('HOMEDRIVE') + GetEnvironmentVariable('HOMEPATH') + TPath.DirectorySeparatorChar +
C_BOSS_CACHE_FOLDER + TPath.DirectorySeparatorChar + C_ENV + AEnv;

if DirectoryExists(GetEnv(EmptyStr)) then
ForceDirectories(GetEnv(EmptyStr));
Result := FHomeDrive + FHomePath + TPath.DirectorySeparatorChar + C_BOSS_CACHE_FOLDER + TPath.DirectorySeparatorChar
+ C_ENV + AEnv;
end;


procedure TBossPackageProcessor.MakeLink(AProjectPath, AEnv: string);
var
LCommand: PChar;
begin
System.TMonitor.Enter(Self);
try
if DirectoryExists(GetEnv(AEnv)) then
TFile.Delete(GetEnv(AEnv));
Expand All @@ -98,15 +98,21 @@ procedure TBossPackageProcessor.MakeLink(AProjectPath, AEnv: string);
on E: Exception do
TProviderMessage.GetInstance.WriteLn('Failed on make link: ' + E.Message);
end;
System.TMonitor.Exit(Self);
end;

constructor TBossPackageProcessor.Create;
begin
FDataFile := TStringList.Create;
FHomeDrive := GetEnvironmentVariable('HOMEDRIVE');
FHomePath := GetEnvironmentVariable('HOMEPATH');

if FileExists(GetDataCachePath) then
FDataFile.LoadFromFile(GetDataCachePath);

if DirectoryExists(GetEnv(EmptyStr)) then
ForceDirectories(GetEnv(EmptyStr));

UnloadOlds;
end;

Expand Down Expand Up @@ -148,7 +154,7 @@ function TBossPackageProcessor.GetBplList: TStringDynArray;

function TBossPackageProcessor.GetDataCachePath: string;
begin
Result := GetEnvironmentVariable('HOMEDRIVE') + GetEnvironmentVariable('HOMEPATH') + TPath.DirectorySeparatorChar +
Result := FHomeDrive + FHomePath + TPath.DirectorySeparatorChar +
C_BOSS_CACHE_FOLDER + TPath.DirectorySeparatorChar + C_DATA_FILE;
end;

Expand Down

0 comments on commit 9e4c19c

Please sign in to comment.