Managing a custom page to display for specific tasks

After hours of searching the internet and struggling, and didn't get anywhere, I decided to seek help here.

What I am trying to accomplish is I am trying to get the IP address from the user and use it as a command line parameter in the [Run] section.

So, I have this:

Name: "License"; Description: "Usb Key License Driver"; GroupDescription: "UsbLicense"; Flags: checkedonce
Name: "License/Desktop"; Description: "Desktop License"; GroupDescription: "UsbLicense"; Flags: exclusive
Name: "License/NetworkClient"; Description: "Network Client License Key"; GroupDescription: "UsbLicense"; Flags: exclusive unchecked


Now, if the user selects the network client, I want to show the custom page and get the IP address and use it like this:

Filename: "{app}\Drivers\Program.exe"; Parameters: "/ip:{code:GetIPhere}"; StatusMsg: "Installing drivers..."; Tasks: License/NetworkClient


I managed to create my own page and run it:

procedure InitializeWizard();


Now for my main question:

1) How can I control WHEN the userform is shown, it appears before it is activated in front of my Task page.

2) If I can get it to show the page after request? How to write code so that it appears in the Client Network state only from a task. (If I do this in the NextButtonClick method, how do I know what is the page id of my custom page?)

Thanks for all that you helped me, I'm just getting so close to finishing my installer, but it makes me go blank.

---- ---- edited

I looked at my problem 1, when creating a custom page, the pageAfter parameter is used and we can use the selectedTask constant to determine that it will appear AFTER the Task page:

procedure InitializeWizard();


Thanks and Regards, Kev84


source to share

1 answer

You can use the Pascal Script WizardSelectedTasks which will return you the sequence of the tasks you have created, just do "Pos" on the returned string and you can determine if your particular task has been selected.

function Form_ShouldSkipPage(Page: TWizardPage): Boolean;
 selectedTask : string;
 skipPage : bool;
  skipPage := true;
  selectedTask := WizardSelectedTasks(false);

  if (Pos('client', selectedTask) > 0) then
    skipPage := false;
  Result := skipPage;





All Articles