Inno Setup - Displays a warning page

I use Inno Script Studio to build the installer, so far very successfully, since Inno Setup is a great package.

However, I want to add a warning page that displays when the user cancels an important task. I thought it would be just a check. After some Googling, I realized that this would require some Pascal scripts - something I, unfortunately, do not know (evidence below) ...

begin if not IsTaskSelected('ImportantTask') then WarningPage := CreateOutputMsgPage(wpSelectTasks, 'Caution', 'Please read the following important information before continuing.', 'You have not selected the ImportantTask option. Click "Back" to reselect ImportantTask, or click "Next" to continue at your own risk.'); end; 

No wonder this didn't work.


Here are the requirements:

  • An important task should be checked by default.
  • If the Important task is not selected, select the Warning check box with the Risk Acknowledgment checkmark.
  • If the risk confirmation flag is not blocked, disable the Next button.

I did not want the large [Code] section to appear in the end, but perhaps there is no other option.
Thanks in advance for your help.

+4
source share
1 answer

Use msgbox pages instead of wizard pages. Msgbox is especially used to provide any guidance (information, warning .. etc.) to the user.
This script works as per your requirement.

 [Setup] AppName=MySetup AppVersion=1.5 DefaultDirName={pf}\MySetup [Tasks] Name: "ImportantTask"; Description: "This task should be selected"; GroupDescription: "Important tasks"; [Code] function NextButtonClick(CurPageID: Integer): Boolean; begin Result := True; if (CurPageID = wpSelectTasks) and not IsTaskSelected('ImportantTask') then Result := Msgbox('You have not selected the ImportantTask option.' + #13#10 + 'Are you sure you want to continue ?', mbInformation, MB_YESNO) = IDYES; end; 

the loan goes to TLama ...

+6
source

Source: https://habr.com/ru/post/1493995/


All Articles