I need to install a specific file only if the user does a new installation. If the user does an update of an existing installation, the file should not be installed.
Is this possible with InnoSetup?
TIA Michael
Inno Setup: How to overwrite on install but not on change? doesn't help in my case, because it is possible that the user sets a new target folder. Setting a new target folder should be handled as a new installation.
So is it possible to detect that there is already an exe in the target folder?
Problem solved:
Source: "build\Install_files\First.ver"; Flags: onlyifdoesntexist; DestDir: "{app}"; Check: not MyFileExists(ExpandConstant('{#MyExe}'))
[Code]
{prueft, ob eine Datei schon im Ziel existiert. Pfadinformationen werden entfernt.}
function MyFileExists(const FileName: String): Boolean;
var
name: string;
begin
name := ExtractFileName(FileName);
FileName := ExpandConstant('{app}\') + name;
Result := FileExists(FileName);
end;