title: Using Innosetup to update IP address in config files
body: <p>I am trying to use the Inno Setup installation dialog box, during installation to update a few configuration files within my installed files. I managed to create a dialog box for user input of the IP address.
  How do I capture the IP address entered, then use it for updating the configuration files? The following are an extraction of the code:</p>
  
  <pre><code>#define MyAppName "My Program"
  #define MyAppVersion "1"
  #define MyAppExeName "MyProg.exe"
  
  [Setup]
  .......
  
  ;;Zip files to be included in the setup
  #define ISSI_Unzip1 "C:\Program Files (x86)\release.zip"
  #define ISSI_UnZipDir1 "C:\Program Files (x86)\....."
  ;;ISSI Include
  #define ISSI_IncludePath "C:\ISSI"  
  #include ISSI_IncludePath+"\_issi.isi"
  
  ....
  [Files]
  Source: "C:\Program Files (x86)\Inno Setup 5   
  \Examples\MyProg.exe";DestDir: "{app}"; Flags: ignoreversion
  Source: "C:\Program Files (x86)\release.zip";      `DestDir: "{#ISSI_UnZipDir1}";     `
  Flags: ignoreversion deleteafterinstall onlyifdoesntexist
  ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  Source:"C:\ISSI\_issi.isi";DestDir: "{tmp}"; Flags:deleteafterinstall 
  
  [Run]
  Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&amp;', '&amp;&amp;')}}"; Flags: nowait postinstall skipifsilent` 
  Filename: "{tmp}\_issi.isi";Parameters:"x ""{tmp}\release.zip""     `-o""{#ISSI_UnZipDir1}";Check: InitializeSetup(); Flags: runhidden runascurrentuser shellexec;`
  
  [Code]
  function httpdCheckedResult:boolean;
  
  begin
    result := FileExists('{#ISSI_UnZipDir1}\release\Apache24\bin\httpd.exe');
  end;
  
  
  function tftpd64CheckedResult:boolean;
  
  begin
    result := FileExists('{#ISSI_UnZipDir1}\release\tftpd64\tftpd64.exe');
  end;
  
  var 
   ServerPage: TInputQueryWizardPage;
   ipaddress: String;
  
  Procedure InitializeWizard();
  begin  
  ServerPage:= CreateInputQueryPage(wpWelcome, 'Network   Interface                Address','IP Address?', 'Please specify the designated network interface IP Address,then click Next.');
  
  //Add item (False means it's not a password edit) 
  ServerPage.Add('IPAddress of Configuration file:',False);
  
  //Set initial values (optional)
  ServerPage.Values[0] := ExpandConstant('{param:ipaddress}');
  
  //Read values into variables
  ipaddress := ServerPage.Values[0];
  end;
  
  function Getipaddress(Param: String): String;
  begin 
     if Param = 'ipaddress' then 
      Result := ServerPage.Values[0]
     else  
      MsgBox('Please enter ip address.', mbInformation, MB_OK);
  end;
  
   function InitializeSetup(): Boolean;
  
     `begin`                                                                                                    
   begin
      if httpdCheckedResult()  then
           begin
           MsgBox('The httpd application is installed already.'mbInformation, MB_OK);
       Result := False;     
       end
  if tftpd64CheckedResult() then
       begin                                           
       MsgBox('The tftpd application is installed already.', mbInformation, MB_OK);
       Result := False;     
       end
   end
  
    begin
      if not httpdCheckedResult() or not tftpd64CheckedResult() then  
      Result := True;
    end;
  
   end;
  </code></pre>
  
  <p>--------------------------------UNQUOTE--------------------------------------
  The following are the contents of the respective configuration files I was trying to update the IP address: </p>
  
  <p>File1: </p>
  
  <pre><code>#!ipxe
  
  # Name: boot.ipxe.cfg
  # Version: 1.3.0
  # Date: 09 JUN 2015
  # Description: Global variables declaration for all iPXE scripts
  ### 
  
  # Base URL used to resolve most other resources
  # Should always end with a slash
  set boot-url http://&lt;IP ADDRESS HERE&gt;/
  
  # ESXi install media base
  set esxi-base-url ${boot-url}esxi
  
  # RHEL install media base
  set rhel-base-url ${boot-url}rhel
  
  # where the current release files are located
  set current ${boot-url}current/ 
  
  # where the kickstart configs are located
  set ks-dir ${current}ks/
  
  # where additional files to be transfered using wget
  set files-dir ${current}files/
  
  
  # OPTIONAL: Relative directory to boot.ipxe used to
  # override boot script for specific clients
  set boot-dir boot/
  
  # REQUIRED: Absolute URL to the menu script, used by boot.ipxe
  # and commonly used at the end of simple override scripts
  # in ${boot-dir}.
  #set uefi-menu-url menuuefi.ipxe
  set menu-url menu.ipxe
  
  # Set netif mac
   set boot-mac ${netX/mac}
   set boot-mac-hyp ${netX/mac:hexhyp}
  </code></pre>
  
  <hr>
  
  <p>Configuration File2 :</p>
  
  <pre><code>bootstate=0
  title=Loading ESXi installer
  timeout=3
  prefix=http://&lt;IP ADDRESS&gt;/esxi65
  kernel=tboot.b00
  kernelopt=runweasel formatwithmbr
  modules=b.b00 --- jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 ---     chardevs.b00 --- a.b00 --- user.b00 --- ......
  ...
  build=updated=0
  </code></pre>