Subversion Repositories DevTools

Rev

Rev 5100 | Rev 5264 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5100 Rev 5240
Line 394... Line 394...
394
        or Error ("Win32::TieRegistry not available");
394
        or Error ("Win32::TieRegistry not available");
395
 
395
 
396
    my $userKey= Win32::TieRegistry->new("CUser")
396
    my $userKey= Win32::TieRegistry->new("CUser")
397
        or  Error( "Can't access HKEY_CURRENT_USER key: $^E" );
397
        or  Error( "Can't access HKEY_CURRENT_USER key: $^E" );
398
 
398
 
-
 
399
    my $localKey= Win32::TieRegistry->new("LMachine")
-
 
400
        or  Error( "Can't access HKEY_LOCAL_MACHINE key: $^E" );
-
 
401
 
-
 
402
    sub checkKeys
-
 
403
    {
-
 
404
        my ($userKey, $localKey, $key) = @_;
-
 
405
        my ($bcKey, $DiffProg);
-
 
406
        $bcKey = $userKey->Open( $key, {Delimiter=>"/"} );
-
 
407
        if ($bcKey && ($DiffProg = $bcKey->GetValue( 'ExePath' )) )
-
 
408
        {
-
 
409
            return $DiffProg;
-
 
410
        }
-
 
411
        $bcKey = $localKey->Open( $key, {Delimiter=>"/"} );
-
 
412
        if ($bcKey && ($DiffProg = $bcKey->GetValue( 'ExePath' )) )
-
 
413
        {
-
 
414
            return $DiffProg;
-
 
415
        }
-
 
416
        return undef;
-
 
417
    }
-
 
418
 
399
    my $bcKey;
419
    my $bcKey;
400
    if ($bcKey = $userKey->Open( "Software/Scooter Software/Beyond Compare 4", {Delimiter=>"/"} ))
420
    if ($DiffProg = checkKeys( $userKey, $localKey,"Software/Scooter Software/Beyond Compare 4" ))
401
    {
421
    {
402
        Verbose("Using BC4");
422
        Verbose("Using BC4");
403
        push @DiffArgs, '/solo';
423
        push @DiffArgs, '/solo';
404
    }
424
    }
405
    elsif ($bcKey = $userKey->Open( "Software/Scooter Software/Beyond Compare 3", {Delimiter=>"/"} ))
425
    elsif ($DiffProg = checkKeys( $userKey, $localKey,"Software/Scooter Software/Beyond Compare 3"))
406
    {
426
    {
407
        Verbose("Using BC3");
427
        Verbose("Using BC3");
408
        push @DiffArgs, '/solo';
428
        push @DiffArgs, '/solo';
409
    }
429
    }
410
    elsif ($bcKey = $userKey->Open( "Software/Scooter Software/Beyond Compare", {Delimiter=>"/"} ))
430
    elsif ($DiffProg = checkKeys( $userKey, $localKey,"Software/Scooter Software/Beyond Compare"))
411
    {
431
    {
412
        Verbose("Using BC2");
432
        Verbose("Using BC2");
413
    }
433
    }
414
    else
434
    else
415
    {
435
    {
416
        Error "Can't access BC2, BC3 or BC4 Keys: $^E";
436
        Error "Can't access BC2, BC3 or BC4 Keys: $^E";
417
    }
437
    }
418
 
438
 
419
    $DiffProg = $bcKey->GetValue( 'ExePath' )
-
 
420
        or Error( "Cannot locate BeyondCompare ExePath in Windows Registry");
-
 
421
 
-
 
422
    Error ("BeyondCompare program not found", "Prog: $DiffProg")
439
    Error ("BeyondCompare program not found", "Prog: $DiffProg")
423
        unless ( -x $DiffProg );
440
        unless ( -x $DiffProg );
424
}
441
}
425
 
442
 
426
#-------------------------------------------------------------------------------
443
#-------------------------------------------------------------------------------