Skip to content

Commit

Permalink
Allow skipping Freelancer.exe when copying directory
Browse files Browse the repository at this point in the history
This fixes the bug where the vanilla FL icon is shown instead of the updated one in some cases.
  • Loading branch information
BC46 committed May 24, 2024
1 parent e988fac commit 5fdeea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ begin
// Copy Vanilla game to directory
UpdateProgress(0);
WizardForm.StatusLabel.Caption := 'Copying vanilla Freelancer directory...';
DirectoryCopy(DataDirPage.Values[0],ExpandConstant('{app}'),False);
DirectoryCopy(DataDirPage.Values[0],ExpandConstant('{app}'), False, True);
UpdateProgress(30);
// Unzip
Expand All @@ -149,7 +149,7 @@ begin
// Copy mod files
WizardForm.StatusLabel.Caption := ExpandConstant('Relocating {#MyAppName}...');
DirectoryCopy(ExpandConstant('{app}\{#MyFolderName}'),ExpandConstant('{app}'),True);
DirectoryCopy(ExpandConstant('{app}\{#MyFolderName}'),ExpandConstant('{app}'), True, False);
DelTree(ExpandConstant('{app}\{#MyFolderName}'), True, True, True);
UpdateProgress(90);
Expand Down
6 changes: 3 additions & 3 deletions utilities.iss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ begin
end;
// Used to copy the vanilla install to {app}, also the extracted .zip file back to {app}
procedure DirectoryCopy(SourcePath, DestPath: string; Move: Boolean);
procedure DirectoryCopy(SourcePath, DestPath: string; Move: Boolean; SkipFlExe: Boolean);
var
FindRec: TFindRec;
SourceFilePath: string;
Expand All @@ -32,7 +32,7 @@ begin
begin
try
repeat
if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
if (FindRec.Name <> '.') and (FindRec.Name <> '..') and not (SkipFlExe and (FindRec.Name = 'Freelancer.exe')) then
begin
SourceFilePath := SourcePath + '\' + FindRec.Name;
DestFilePath := DestPath + '\' + FindRec.Name;
Expand All @@ -56,7 +56,7 @@ begin
else
begin
if DirExists(DestFilePath) or CreateDir(DestFilePath) then
DirectoryCopy(SourceFilePath, DestFilePath, Move)
DirectoryCopy(SourceFilePath, DestFilePath, Move, SkipFlExe)
else
RaiseException(Format('Failed to create %s', [DestFilePath]));
end;
Expand Down

0 comments on commit 5fdeea9

Please sign in to comment.