title: Passing values into a procedure from NextButtonClicked method Inno Setup
body: <p>Currently I'm trying to make an installer utility that sets the static IP for the Wi-Fi on Inno Setup.  I'm having trouble finding a way to make the correct command insert when the <em>Next</em> button of custom page is pressed.  The <code>NextButtonClick</code> method is called correctly however when I actually hit the next button on my page it merely exits without executing the query.</p>
  
  <pre class="lang-pascal prettyprint-override"><code>procedure InitializeWizard();
  var
    Page: TInputQueryWizardPage;
    ipAddress, subnetMask, defaultGateway, prefferredDNSServer: String;
    ResultCode: Integer;
  begin
    Page := CreateInputQueryPage(wpWelcome,
      'Set Network Config', 'A window for setting the wifi configuration',
      'Please indicate the IP address and press next when finished.');
  
    { Add items (False means it's not a password edit) }
    Page.Add('IP Address:', False);
    Page.Add('Subnet mask:', False);
    Page.Add('Default gateway:', False);
    Page.Add('Preferred DNS server:', False);
  
    { Set initial values (optional) }
    Page.Values[0] := ExpandConstant('0.0.0.0');
  
    ipAddress := Page.Values[0]
  
    Page.Values[1] := ExpandConstant('0.0.0.0');
  
    subnetMask :=  Page.Values[1]
  
    Page.Values[2] := ExpandConstant('0.0.0.0');
  
    defaultGateway :=  Page.Values[2]
  
    Page.Values[3] := ExpandConstant('0.0.0.0');
  
    prefferredDNSServer :=  Page.Values[3]
  
    if NextButtonClick(Page.ID) then
    begin
      Exec('cmd.exe',
           '/k ' + 'netsh interface ip set address "Wi-Fi" static ' + ipAddress + ' ' +
             subnetMask + ' ' + defaultGateway + ' ' + prefferredDNSServer,
           '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
    end;
  end; 
  
  function NextButtonClick(CurPageID: Integer): Boolean;
  var
    ipAddress, subnetMask, defaultGateway, prefferredDNSServer: String;
    ResultCode: Integer;
  begin
    Result := True
  
    Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
    case CurPageID of
      100:
        { ipAddress := getParams(ipAddress); }
        { setWifi(ipAddress, subnetMask, defaultGateway, prefferredDNSServer); }
        Result:= True;
    end;
  end;
  </code></pre>