Originally, this article was entitled "How to make Windows' Drush Make command work in Drush 5.7" but it has evolved into "How to manually upgrade Drush on Windows XP and 7".
The Drush Make command does not work in Windows 7 / Vista, when using Drush release 5.5, 5.6, or 5.7. There is a Drush 5.8 windows installer, which fixes the make issue. However, if you want to upgrade to drush 5.9 or 6.0, there are no installers for them. No worries. This article will provides instructions for manually installing the latest version of Drush in Windows.
Original Issue: Drush make (5.5, 5.6, 5.7) does not work in Windows
The Drush Make command does not work in Windows 7 / Vista, when using Drush release 5.5, 5.6, or 5.7. When running the command “drush make das-D7.make test-site”, I received a “drush_make_tmp_xxx being not readable or not existing” error. This is not a problem because the drush 5.8 windows installer fixes this issue!
Below is a copy of the make file , the Drush command, and the resulting error:
core = 7.x
api = 2
projects = drupal
$ drush make das-D7.make das-test
Source directory [error]
drupal-7.16 is not readable or does not exist.
Project drupal (7.16) could not be downloaded to [error]
How to manually install the latest version of Drush on Windows
I have noticed that the Drush Window Installer is always released much later than Drush on Drupal.org. No worries. This article provides instructions to manually installing the latest development version of Drush in Windows.
I resent started playing with Drupal 8 and found that Drush 6 was needed to download Drupal 8 modules. On April 25th, 2013 I updated and followed the below instructions to upgrade from Drush 5.8 to Drush 6 and they worked fine. If you have any issues, please post a comment below and I will respond. Thanks.
Regardless of which of the of the two below methods you use, you will want to download the latest version of Drush into a temporary directory. Do NOT download the Drush module into any web site!. This is because we will manually move the contents of the temporary Drush directory to the Drush program directory.
There are few ways to download the latest version of drush. You can either:
- Issue a git clone command to clone the 7.x-5.x or 8.x-6.x branch.
- Download the latest development version, which was released on April 25, 2013 (as of this writing).
In either case, you will need to open a git bash window. All of the below commands need to entered in the git bash windows (except where the instructions state to open Windows Explorer)
Clone the software
Open up a git bash directory and navigate to the root directory of your "C" drive. Create a temporary directory, in my case I called it das_temp. (Please remember to delete your temporary directory when you are done with this process.) You do this by issuing the following command:
Once you are in the temporary directory you created above, you can issue the the appropriate git command to clone the latest drush version.
You can use Drush 5.x if you are on Drupal 6 or 7. The git command is:
git clone --recursive --branch 7.x-5.x http://git.drupal.org/project/drush.git
If you want to run Drupal 8 in addition to Drupal 6 and 7, you should use Drush 6. Note: Drush 6 now has a beta release. You can either download the beta release by downloading the zip and unzipping it. Or you can download the 8.x-6.x development branch from the Drush git repository using the following command:
git clone --recursive --branch 8.x-6.x http://git.drupal.org/project/drush.git
To get to the page that contains the git commands for drush, you can go to the drush version control page. The below form should appear.
Select which version you want to copy from the drop box entitled "Version to work from" and click on the "Show" button. The git command will be display in the box entitled "Setting up repository for the first time". Simply copy the git clone command from the git page and paste it into your bash window. Then run the git clone command.
Download the software
You can also download the latest development version of drush by:
- Going to the http://drupal.org/project/drush web page
- Navigating to the Development Releases box in the Download section of the page.
- Clicking on the zip file that is on the “7.x-5.9” line or
- Clicking on the zip file that is on the "8.x-6.0-beta1" line.
- And unzipping the downloaded file to the temporary directory (C:\das_temp in my case) that you created on your computer.
Ok, I have downloaded the software - now what?
At this point you should have a sub-directory called drush in your temporary directory. In my case, the full path is C:\das_temp\drush. The folder should contain the following six directories and some files:
classes (depending upon which version you download)
And the following 10 files:
Copy the files to the appropriate directory / folder
At this point we’re ready to copy this directory to its final destination. However, the files have to be copied to different directories depending upon your version of Windows (XP vs 7). Other than the program file location, the instructions for Windows XP and 7 are the same. I'm going to guess that Vista users should follow the Windows 7 instructions, but I've not tested it on Vista.
Display hidden file and directories.
Fortunately, you can un-hide files and directory with a few clicks of your mouse. Microsoft has instructions for displaying hidden files and folders for Windows XP . This link contains the instructions for Vista / Windows 7 .
If you are not a fan of Microsoft instructions, you can google either "display hidden files in windows xp" or "display hidden files in windows 7". You will find plenty of instructions.
Warning:When you unhide files, two new icons will appear on your desktop. Both of them have the same name: desktop.ini. Do not delete these icons. If you want, once you have copied the drush directory, you can turn back on hide "hidden files".
Per Cindy's comment (comment # 6) below, the instructions for XP are different from Windows 7 (thanks Microsoft).
In WinXP the folder to copy into is C:\Documents and Settings\All Users\Application Data\Drush. The Application Data directory is also a hidden folder. (Please see above instructions regarding hidden folders).
There is an extra folder named classes (containing one file named DrushRole.php) in the unzipped drush-All-versions-5.x-dev that was not in the download on the Windows 7 machine. I went ahead and copied it over with all the others into the C:\Documents and Settings\All Users\Application Data\Drush directory with all the rest of the folders and files.
The program files is C:/Program Data/drush. By default, the Program Data directory, is hidden by Microsoft. Therefore, it cannot be seen in Windows Explorer until it is un-hidden.
Install new version of drush
You will need to move (or copy) your temporary Drush directory from your temporary directory to C:/ProgramData directory. However, you should either rename or delete the existing C:/ProgramData/drush directory before you replace it with the new Drush directory. You can do this the directory by:
- Open Windows Explorer
- Navigating to the C:/ ProgramData directory.
- Locate and delete (or rename) the exiting Drush sub directory.
- Move (or copy) the Drush directory you placed in the temporary directory to C:/ProgramData/Drush.
Congratulations - You have now installed the Drush 6 development on your computer!
To test it, enter the following command and you should get the following results:
$ drush status
PHP configuration : C:\Program Files (x86)\Drush\Php\php.ini
Drush version : 6.0-dev
Drush configuration :
|ScreenHunter_66 Nov. 02 09.29.jpg||24.16 KB|