mrjackdavis / grunt-msdeploy

GNU General Public License v2.0
3 stars 6 forks source link

Including msdeploy doesn't fix dependency issues #1

Closed tqc closed 10 years ago

tqc commented 10 years ago

If running on a system without msdeploy installed, the error is now:

Warning: Command failed: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

mrjackdavis commented 10 years ago

Hmm I was hoping it would work if I included msdeploy.exe. Evidently not. My initial implementation threw an exception if it couldn't find msdeploy in Program files. My suggestion is that MsDeploy needs to be installed on the system; regardless the plugin should be smart enough to tell you that. Any ideas on how to figure that out?

tqc commented 10 years ago

A simple file existence check should be enough - if msdeploy.exe isn't in the usual place, display the download url instead of trying to run the deployment.

As long as you add an option to set the path manually there is no need to handle msdeploy being installed somewhere non-standard.

mrjackdavis commented 10 years ago

I was having issues pointing to exactly where that file would be. It is in a different directory if the installation is 64 or 32 bit. I guess I could check both locations, if neither are found then throw an exception (or grunt log an error), explaining msdeploy needs to be downloaded and include a link. Sound good?

mrjackdavis commented 10 years ago

Did not mean to close that. Oops.

tqc commented 10 years ago

I don't think I have ever used that close & comment button on purpose.

Two hardcoded paths should cover 99% of cases, and you can use the environment variables if you want to handle non-english versions of windows:

process.env.ProgramFiles
process.env["ProgramFiles(x86)"]
mrjackdavis commented 10 years ago

Sounds like a plan, not sure when I'll have a chance to throw it in. Hopefully soon.

mrjackdavis commented 10 years ago

Got my head isn't screwed on very well. I just committed the aforementioned changes with the comment, fixes #45. But... this is not #45, this is #1.

Nevertheless this should be fixed now :)

It's been published to NPM as version 0.1.2