Advertisement
TLama

Untitled

Dec 21st, 2014
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.11 KB | None | 0 0
  1. [Code]
  2. type
  3.   TTargetPlatform = (x86, x64);
  4.   TTargetPlatforms = set of TTargetPlatform;
  5.  
  6. procedure InstallVCRedist2013(Platforms: TTargetPlatforms);
  7. begin
  8.   // if we requested x64 version, Windows is 64-bit and there's no x64 version of VC runtime, then...
  9.   if (x64 in Platforms) and IsWin64 and not VCVersionInstalled(VC_2013_REDIST_x64) then
  10.   begin
  11.     // AddProduct for the x64 version here
  12.     AddProduct(64-bit...);
  13.     // we exit this function since the x64 version is going to be installed and your code currently
  14.     // installs only one of them (in case of target_x64x86_Either == True)
  15.     Exit;
  16.   end;
  17.   // either only x86 was requested, or Windows is not 64-bit, or x64 version of VC runtime is already
  18.   // installed (because if the x64 was added for installation, we exit the function); in this case...
  19.   if (x86 in Platforms) and not VCVersionInstalled(VC_2013_REDIST) then
  20.   begin
  21.     // AddProduct for the x86 version here
  22.     AddProduct(32-bit...);
  23.   end;
  24. end;
  25.  
  26. // and possible calls of the function...
  27. InstallVCRedist2013([x86]);
  28. InstallVCRedist2013([x64]);
  29. InstallVCRedist2013([x86, x64]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement