Inno Setup - display warning page
inno-setup
Solution
Use msgbox's instead wizard pages. Msgbox's are especially used for Giving any indication(info,warning..etc) to 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;
credit goes to TLama...
Problem
I'm using Inno Script Studio to build an installer, so far very successfully as Inno Setup is a great package. However, I want to add a warning page which is displayed when the user unchecks an important Task. I thought this would just be an easy check. After some Googling, I realised that this will require some Pascal scripting - something that I unfortunately have no knowledge of (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; ``` Unsurprisingly, this didn't work. Here are the requirements: - ImportantTask is to be checked by default. - If ImportantTask is unselected then display WarningPage with Risk Acknowledgement checkbox. - If risk acknowledgement checkbox is unticked, disable the Next button. I didn't want to end up with a large [Code] section, but there is possibly no other option. Thanks in advance for the help.