Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Deploy script error - msdeploy.exe is not found on this machine

I'm trying to execute a web deploy script on a clean build Windows Server 2008 R2 machine and getting the following error:

ERROR: The system was unable to find the specified registry key or

value. msdeploy.exe is not found on this machine. Please install Web Deploy before execute the script.

The package was created in VS2010 and executes fine on my development box (as always!). If I import the package on the server through IIS everything works fine.

Web Deploy has been installed on the server through the Web Deployment Tool 2.1 via the Web P.I and I've verified the inclusion of msdeploy.exe. I'm running the script through the "IIS Extensions/Web Deploy Command Line" start menu item so I'm guessing that the correct paths should be set. I've also tried it as Administrator with the same error.

Any help greatly appreciated.

like image 707
Darren Lewis Avatar asked May 12 '11 07:05

Darren Lewis


1 Answers

Copied from here:

There is an error with the way Microsoft’s Web Deploy 2.1 application creates command line packages from Visual Studio 2010.

If you create a package to publish and then try to run the msdeploy.exe command line publishing tool it on a production server running IIS then you may receive the following error:

ERROR: The system was unable to find the specified registry key or value. msdeploy.exe is not found on this machine. Please install Web Deploy before execute the script.

Assuming that you actually have installed Web Deploy from http://www.iis.net/download/WebDeploy then the error may be caused by an incorrect registry path variable in the .cmd file that Visual Studio creates.

Open up the .deploy.cmd file that is part of your deployment package in a text editor and look for the following code block:

if "%MSDeployPath%" == "" (
for /F "usebackq tokens=2*" %%i  in 
(`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`)
do (if "%%~dpj" == "%%j" ( 
set MSDeployPath=%%j

If you have installed Web Deploy 2.0 or higher, then the error is caused by the registry query to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1. If you open up regedit on your production server you’ll find that the appropriate key is actually HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2.

Change the reference in the.deploy.cmd file and you’ll be able to successfully run the deployment package.

like image 197
Brian Maddox Avatar answered Sep 30 '22 19:09

Brian Maddox