How to override file_public_path in install profile?
You probably want to look at this very recent blog post from PreviousNext: Collecting and writing configuration settings to setting.php from an install profile for answers to this question and your other about creating your own step in an install profile.

From that blog post regarding their install profiles form submit handler:


  Then we had to do the actual storing of these variables. Now at this
  stage the database connection is not setup so you cannot call
  variable_set(), you have to use another of Drupal's lesser known api
  functions - drupal_rewrite_settings(). This is the function Drupal
  uses to write the $databases variable to your settings.php. But with
  some minor wrangling you can use it to also write $conf variables to
  settings.php, which are from that point forward available for use via
  variable_get(). And therefore available for us to use to define our
  connection settings for the solr server. Because
  drupal_rewrite_settings should only be called once (to avoid having
  your settings overridden) we had to duplicate what the standard
  install does - ie writing the database settings - then we could write
  our own $conf settings.