Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use multiple Check functions in the [Registry] section? [duplicate]

Sample:

Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
  ValueType: dword; ValueName: "ReuseCong"; ValueData: "{code:ReuseCongregation}"; \
  Flags: uninsdeletevalue; Check: IsNewInstall IsWin64
Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
  ValueType: dword; ValueName: "Duplicate"; ValueData: "{code:Duplicate}"; \
  Flags: uninsdeletevalue; Check: IsNewInstall IsWin64
Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
  ValueType: dword; ValueName: "Language"; ValueData: "{code:DatabaseLanguage}"; \
  Flags: uninsdeletevalue; Check: IsNewInstall IsWin64

Will not compile:

Error on line 406 in setup.iss: Directive or parameter "Check" expression error: Invalid token 'IsWin64' found.


I can't change the IsNewInstall function:

// Returns True if we are performing a new install
function IsNewInstall(): Boolean;
begin
  // Make sure IsUpgrading has already beed called.
  result := not bIsUpgrading;
end;

But I include it if it helps.

like image 530
Andrew Truckle Avatar asked Sep 12 '25 14:09

Andrew Truckle


1 Answers

The Check parameter supports simple boolean operators like or or and. Examples are given at the end of Components and Tasks Parameters documentation.

You want and here, I assume:

Check: IsNewInstall and IsWin64

Alternatively, particularly if the expression gets too complicated or when it is used frequently, you can factor it out to a separate function:

function IsNewInstallOnWin64: Boolean;
begin
  Result := IsNewInstall and IsWin64;
end;
like image 69
Martin Prikryl Avatar answered Sep 14 '25 15:09

Martin Prikryl