diff --git a/boss_ide.dproj b/boss_ide.dproj index 0e93285..582f159 100644 --- a/boss_ide.dproj +++ b/boss_ide.dproj @@ -157,8 +157,6 @@ Microsoft Office 2000 Sample Automation Server Wrapper Components Microsoft Office XP Sample Automation Server Wrapper Components - Embarcadero C++Builder Office 2000 Servers Package - Embarcadero C++Builder Office XP Servers Package diff --git a/src/core/Boss.Modules.PackageProcessor.pas b/src/core/Boss.Modules.PackageProcessor.pas index e83e7fe..c42e07e 100644 --- a/src/core/Boss.Modules.PackageProcessor.pas +++ b/src/core/Boss.Modules.PackageProcessor.pas @@ -9,6 +9,8 @@ interface TBossPackageProcessor = class private FDataFile: TStringList; + FHomeDrive: string; + FHomePath: string; function GetBplList: TStringDynArray; function GetBinList(ARootPath: string): TStringDynArray; @@ -76,11 +78,8 @@ 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; @@ -88,6 +87,7 @@ procedure TBossPackageProcessor.MakeLink(AProjectPath, AEnv: string); var LCommand: PChar; begin + System.TMonitor.Enter(Self); try if DirectoryExists(GetEnv(AEnv)) then TFile.Delete(GetEnv(AEnv)); @@ -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; @@ -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;