diff --git a/setup.iss b/setup.iss index 8d3006f..badeb0a 100644 --- a/setup.iss +++ b/setup.iss @@ -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 @@ -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); diff --git a/utilities.iss b/utilities.iss index 1175d6a..190f661 100644 --- a/utilities.iss +++ b/utilities.iss @@ -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; @@ -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; @@ -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;