Auto login after wordpress installation

Your problem seems to be that you hook in too early (aside from the problem that you’re editing a core file), so let’s take a look at wp-admin/install.php:

No hooks at all, but at the end of the page when everything was properly rendered, there’s a call for wp_print_scripts( 'user-profile' ). And gladly there we’ll find a number of hooks. One that directly sits inside that function on top of it and is named after the function itself: wp_print_scripts. And other inside WP_Scripts.

So let’s give this a try (untested) with a small custom plugin:

<?php
defined( 'ABSPATH' ) or exit;
/* Plugin Name: (#129229) Auto-Login User after install */

add_action( 'wp_print_scripts', 'wpse129229LoginAfterInstall' );
function wpse129229LoginAfterInstall()
{         
    $user = wp_signon( array(
        'remember'      => true,
        'user_login'    => $_POST['user_name'],
        'user_password' => $_POST['admin_password'],
    ), false );

    if ( is_wp_error( $user ) )
        echo $user->get_error_message();                

    exit( wp_redirect( home_url( "products" ) ) );
}

I’m not sure if admin_password is the proper form field id/name. Normally/IIRC WP uses user_password. Second, the user won’t get logged in with home_url( "products" ). You’ll need to use admin_url() for that.

Last Note: NEVER EVER edit a core file. You’ll loose all the changes during any upgrade. If it would be just about installing (and not upgrading) your way of doing it would somehow even be valid (if you want to maintain a WP fork), but not if you want to upgrade.