Ejemplo n.º 1
0
static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform )
{
    MSISUMMARYINFO *si = MSI_GetSummaryInformationW( transform, 0 );
    UINT valid_flags = 0, wanted_flags = 0;

    if (si) wanted_flags = msi_suminfo_get_int32( si, PID_CHARCOUNT );
    TRACE("validation flags %x\n", wanted_flags);

    if (wanted_flags & ~(MSITRANSFORM_VALIDATE_PRODUCT|MSITRANSFORM_VALIDATE_LANGUAGE))
        FIXME("unsupported validation flags %x\n", wanted_flags);

    if (wanted_flags & MSITRANSFORM_VALIDATE_PRODUCT)
    {
        WCHAR *package_product = msi_dup_property( package->db, szProductCode );
        WCHAR *transform_product = msi_get_suminfo_product( transform );

        TRACE("package = %s transform = %s\n", debugstr_w(package_product), debugstr_w(transform_product));

        if (!transform_product || strstrW( transform_product, package_product ))
        {
            valid_flags |= MSITRANSFORM_VALIDATE_PRODUCT;
        }
        msi_free( transform_product );
        msi_free( package_product );
    }
    if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE)
    {
        WCHAR *template;
Ejemplo n.º 2
0
    if (!package->num_langids || !langid) return TRUE;
    for (i = 0; i < package->num_langids; i++)
    {
        if (package->langids[i] == langid) return TRUE;
    }
    return FALSE;
}

static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
{
    LPWSTR prod_code, patch_product, template = NULL;
    UINT ret = ERROR_FUNCTION_FAILED;

    prod_code = msi_dup_property( package->db, szProductCode );
    patch_product = msi_get_suminfo_product( patch );

    TRACE("db = %s patch = %s\n", debugstr_w(prod_code), debugstr_w(patch_product));

    if (strstrW( patch_product, prod_code ))
    {
        MSISUMMARYINFO *si;
        const WCHAR *p;

        si = MSI_GetSummaryInformationW( patch, 0 );
        if (!si)
        {
            ERR("no summary information!\n");
            goto end;
        }
        template = msi_suminfo_dup_string( si, PID_TEMPLATE );