Exemple #1
0
//////////////////////////////////////////////////////////
//
// HandleSpecialLaunchOptions
//
// Check and handle commands (from the installer)
//
//////////////////////////////////////////////////////////
void HandleSpecialLaunchOptions( void )
{
    // Handle service install request from the installer
    if ( CommandLineContains( "/kdinstall" ) )
    {
        UpdateMTAVersionApplicationSetting( true );
        if ( CheckService( CHECK_SERVICE_POST_INSTALL ) )
            return ExitProcess( EXIT_OK );
        return ExitProcess( EXIT_ERROR );
    }

    // Handle service uninstall request from the installer
    if ( CommandLineContains( "/kduninstall" ) )
    {
        UpdateMTAVersionApplicationSetting( true );
        if ( CheckService( CHECK_SERVICE_PRE_UNINSTALL ) )
            return ExitProcess( EXIT_OK );
        return ExitProcess( EXIT_ERROR );
    }

    // No run 4 sure check
    if ( CommandLineContains( "/nolaunch" ) )
    {
        return ExitProcess( EXIT_OK );
    }
}
//////////////////////////////////////////////////////////
//
// CInstallManager::_InstallFiles
//
//
//
//////////////////////////////////////////////////////////
SString CInstallManager::_InstallFiles ( void )
{
    WatchDogReset ();

    // Install new files
    if ( !InstallFiles ( m_pSequencer->GetVariable ( SILENT_OPT ) != "no" ) )
    {
        if ( !IsUserAdmin () )
            AddReportLog ( 3048, SString ( "_InstallFiles: Install - trying as admin %s", "" ) );
        else
            AddReportLog ( 5049, SString ( "_InstallFiles: Couldn't install files %s", "" ) );

        m_strAdminReason = _("Install updated MTA:SA files");
        return "fail";
    }
    else
    {
        UpdateMTAVersionApplicationSetting ();
        AddReportLog ( 2050, SString ( "_InstallFiles: ok %s", "" ) );
        return "ok";
    }
}