Simply putting Tcl\bin first in %PATH% ought to suffice

I think that would mean that everything that wants to load zlib1.dll will then load the one that's in Tcl/bin.
What if there's something that needs to load the other (different) zlib1.dll ? It may now break - a somewhat unlikely scenario, admittedly :-)

If you want to ensure that Tcl/bin/Tcl.dll (and nothing else) loads that C:/Tcl/bin/zlib1.dll you can:
1) Copy C:/Tcl/bin/zlib1.dll to, say, C:/Tcl/bin/zxxxx.dll;
2) In C:/Tcl/bin/Tcl.dll, change every occurrence of "zlib1.dll" to "zxxxx.dll". It's best to do this second step programmatically, and to keep a backup copy of the original Tcl.dll in case something goes awry.

This hack (which I've used many times, though not with Tcl) ensures that the Tcl.dll will load zxxxx.dll instead of zlib1.dll - so it doesn't matter how many zlib1.dll files are in the path.

However, you can't just pick *any* arbitrary name for the zlib1.dll copy - the name of the copy must contain the same number of characters as the original.
That is, for this particular dll, the name you choose must consist of exactly 5 characters - it doesn't matter what those characters are, so long as they are valid filename characters.

Update: I probably should give some sort of indication of the program I would use to effect this hack. This is untested:
use strict; use warnings; use File::Copy; File::Copy::copy('Tcl.dll', 'Tcl.dll_bak') or die $!; open my $infh, '<', 'Tcl.dll' or die $!; open my $outfh, '>', 'Tcl.dll_new' or die $!; binmode($infh); binmode($outfh); while(<$infh>) { $_ =~ s/zlib1\.dll/zxxxx.dll/g; print $outfh, $_; }
Then check that Tcl.dll, Tcl.dll_bak and Tcl.dll_new all exist.
If they do, remove Tcl.dll and rename Tcl.dll_new to Tcl.dll.
If they don't exist .... freak !!

The actual code that I would be using does all of the removing and renaming, too.
And it does some stuff with permissions - though I'm not sure whether that's generally necessary:
close $infh; close $outfh; my $mode = (stat('Tcl.dll'))[2]; my $newmode = $mode | 0220; chmod($newmode, 'Tcl.dll'); unlink 'Tcl.dll'; File::Copy::copy( 'Tcl.dll_new', 'Tcl.dll') or die $!; chmod($mode, 'Tcl.dll'); unlink('Tcl.dll_new');


Cheers,
Rob

In reply to Re^9: Tcl for Strawberry Perl on Windows 64bit by syphilis
in thread Tcl for Strawberry Perl on Windows 64bit by DaveARoberts

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.