Comment: lets make sure we are working with IIS7
Get System Setting Internet Information Server 7 into IIS7
Comment: display the main dialog and retrieve the website's name
Set Variable WEBSITE to 
Display Dialog: main, wait for dialog to return (modal)
Comment: get our Windows directory
Get Common Folder Location System->Windows Directory into WINDOWSDIR
if Variable IIS7 Equals TRUE
  Comment: save the file name of appcmd.exe
  Set Variable APPCMD to $WINDOWSDIR$system32\inetsrv\appcmd.exe
  Comment: run our batch file and pass the appropriate parameters
  Run Program $SUPPORTDIR$run_appcmd.bat "$APPCMD$"  list site "$WEBSITE$" "$TEMPDIR$appcmdoutput.txt" (WAIT)
  Comment: read from the text file that has the stdout of appcmd
  Read from Text File $TEMPDIR$appcmdoutput.txt into Variable APPCMDOUTPUT
  Delete Files $TEMPDIR$\appcmdoutput.txt (when installing)
  Apply Install
  Comment: parse the file and extract the TCP port
  Parse String $APPCMDOUTPUT$ into Variables  and APPCMDOUTPUT (Split at first occurrence of pattern)
  Parse String $APPCMDOUTPUT$ into Variables SITEINDEX and  (Split at first occurrence of pattern)
  if Variable SITEINDEX not Equals 
    MessageBox: Success, $WEBSITE$'s index: $SITEINDEX$
  else
    MessageBox: Error, Site index could not be retrieved.
  end
else
  MessageBox: Error, IIS7 not found.
end
 
 
