Advertisement
TLama

Untitled

Jul 29th, 2013
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.41 KB | None | 0 0
  1. [Setup]
  2. AppName=MySetup
  3. AppVersion=1.5
  4. DefaultDirName={pf}\MySetup
  5.  
  6. [Tasks]
  7. Name: "ImportantTask"; Description: "This task should be selected"; GroupDescription: "Important tasks";
  8.  
  9. [Code]
  10. function NextButtonClick(CurPageID: Integer): Boolean;
  11. begin
  12.   Result := True;
  13.  
  14.   if CurPageID = wpSelectTasks then
  15.   begin
  16.     if not IsTaskSelected('ImportantTask') then
  17.     begin
  18.       if MsgBox('You have not selected the ImportantTask option.' + #13#10 +
  19.         'Are you sure you want to continue ?', mbInformation, MB_YESNO) = IDNO
  20.       then
  21.         Result := False;
  22.     end;
  23.   end;
  24. end;
  25.  
  26. // or yet simplified the above event method
  27. [Code]
  28. function NextButtonClick(CurPageID: Integer): Boolean;
  29. begin
  30.   Result := True;
  31.  
  32.   if (CurPageID = wpSelectTasks) and not IsTaskSelected('ImportantTask') then
  33.   begin
  34.     Result := Msgbox('You have not selected the ImportantTask option.' + #13#10 +
  35.       'Are you sure you want to continue ?', mbInformation, MB_YESNO) = IDYES;
  36.   end;
  37. end;
  38.  
  39. // or yet another simplification of the above event method (without begin..end block)
  40. [Code]
  41. function NextButtonClick(CurPageID: Integer): Boolean;
  42. begin
  43.   Result := True;
  44.  
  45.   if (CurPageID = wpSelectTasks) and not IsTaskSelected('ImportantTask') then
  46.     Result := Msgbox('You have not selected the ImportantTask option.' + #13#10 +
  47.       'Are you sure you want to continue ?', mbInformation, MB_YESNO) = IDYES;
  48. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement