src/extensibility/node/ExtensionManagerDomain.js
function _removeAndInstall(packagePath, installDirectory, validationResult, callback) {
    // If this extension was previously installed but disabled, we will overwrite the
    // previous installation in that directory.
    fs.remove(installDirectory, function (err) {
        if (err) {
            callback(err);
            return;
        }
        _performInstall(packagePath, installDirectory, validationResult, callback);
    });
}
function _removeAndInstall(packagePath, installDirectory, validationResult, callback) {
    // If this extension was previously installed but disabled, we will overwrite the
    // previous installation in that directory.
    fs.remove(installDirectory, function (err) {
        if (err) {
            callback(err);
            return;
        }
        _performInstall(packagePath, installDirectory, validationResult, callback);
    });
}
function _removeAndInstall ( packagePath , installDirectory , validationResult , callback ) { // If this extension was previously installed but disabled, we will overwrite the // previous installation in that directory. fs . remove ( installDirectory , function ( err ) { if ( err ) { callback ( err ) ; return ; } _performInstall ( packagePath , installDirectory , validationResult , callback ) ; } ) ; }
Private function to remove the target directory and then install.

@param {string} Absolute path to the package zip file
@param {string} Absolute path to the destination directory for unzipping
@param {Object} the return value with the useful information for the client
@param {Function} callback function that is called at the end of the unzipping
Private function to remove the target directory and then install .