What I do to easily switch between different DMD versions and libraries on Windows

Don Clugston dac at nospam.com.au
Thu Jun 21 02:19:12 PDT 2007


Anders Bergh wrote:
> Since there are now two D versions, I figured some of you might be
> interested in the trick I use on Windows to switch between compilers
> easily.
> 
> I have DMD 1.016 (Phobos), DMD 1.014 (Tango) and DMD 2.000. Switching
> between versions is only two clicks away.
> 
> 
> 
> Things you will need:
> 
> 1. Windows 2000 or above.
> 
> 2. NTFS file system.
> 
> 3. http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
> This tool lets you create directory symlinks (NTFS junctions).
> 
> 1. Extract "junction.exe" into your PATH, I simply extracted it into 
> C:\Windows.
> 
> 2. Extract dmd 1.x into c:\dmd1_phobos.
> 
> 3. Extract dmd 2.x into c:\dmd2_phobos.
> 
> 4. Open notepad, copy/paste this into a new file, "dmd1_phobos.bat":
> 
> @echo off
> rem Deletes the current symlink and replaces it with a new one.
> junction -d c:\dmd
> junction c:\dmd c:\dmd1_phobos
> 
> 5. Do the same for your other DMD installations, just replace
> "c:\dmd1_phobos" with "c:\dmd2_phobos", etc.
> 
> 
> To change between DMD versions, simply double click the corresponding
> batch file. The location of the batch files does not matter.
> 
> I hope this helps someone out there, it sure did make things easier
> for me when playing around with Tango and 2.0 :-)

Great! But is it necessary to delete the old symlink? It seems to work fine if 
you don't.
Then, the first time after you run one of your batch files, you can go into 
explorer and give the 'c:\dmd' folder a funny icon, or set its hidden attribute.
This greatly reduces the chance of inadvertently deleting it, and creating 
havoc, as Daniel described.



More information about the Digitalmars-d mailing list