mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Delete the venv folder prior to upgrade. Fixes #3384
This commit is contained in:
parent
ba8829b64f
commit
5f51c39e6f
@ -164,6 +164,37 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// This function would be called during upgrade mode
|
||||||
|
// In upgrade mode - delete venv/* for example
|
||||||
|
procedure DelFolder(Path: string);
|
||||||
|
var
|
||||||
|
FindRec: TFindRec;
|
||||||
|
FilePath: string;
|
||||||
|
begin
|
||||||
|
if FindFirst(Path + '\*', FindRec) then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
repeat
|
||||||
|
if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
|
||||||
|
begin
|
||||||
|
FilePath := Path + '\' + FindRec.Name;
|
||||||
|
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
|
||||||
|
begin
|
||||||
|
DeleteFile(FilePath);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
DelFolder(FilePath);
|
||||||
|
RemoveDir(FilePath);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
until not FindNext(FindRec);
|
||||||
|
finally
|
||||||
|
FindClose(FindRec);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
//procedure CurPageChanged(CurPageID: Integer);
|
//procedure CurPageChanged(CurPageID: Integer);
|
||||||
function NextButtonClick(CurPageID: Integer): Boolean;
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
||||||
var
|
var
|
||||||
@ -186,6 +217,7 @@ begin
|
|||||||
if (IsUpgradeMode) then
|
if (IsUpgradeMode) then
|
||||||
begin
|
begin
|
||||||
DelWebfolder(ExpandConstant('{app}\web'));
|
DelWebfolder(ExpandConstant('{app}\web'));
|
||||||
|
DelFolder(ExpandConstant('{app}\venv'));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user