Why doesn't variable_set() work in an installation profile? I'm writing an installation profile, and I want to display some forms on some pages. The form below intended to set a variable at submission time. It does not work in the profile, but it works on an installed site. Why? Where is mistake?

function myprofile_install_mode_form() {
  $form = array();
  $form['myprofile_install_mode'] = array(
    '#type' =&gt; 'radios',
    '#title' =&gt; st('Please select'),
    '#default_value' =&gt; 0,
    '#description' =&gt; '',
    '#options' =&gt; array(st('Option 1'), st('Option 2')),
  );
  $form['actions'] = array('#type' =&gt; 'actions');
  $form['actions']['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; st('Continue'),
  );  
  return $form;
}
// Submit handler
function myprofile_install_mode_form_submit(&amp;$form, &amp;$form_state) {
  $value = $form_state['values']['myprofile_install_mode'];
  variable_set('myprofile_install_mode', $value);
}
variable_set() works fine in installation profiles (standard_install() uses it), it's more likely that the submit handler for your form isn't being run. I seem to remember having to explicitly set the submit handler for one of these extra installation forms:

$form['#submit'][] = 'myprofile_install_mode_form_submit';


Try adding a call to drupal_set_message() in the form submit handler to make sure your code is definitely being run.