Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalCommandLineTask uses WorkingDirectory instead of ExecutableIsLocatedAt #46

Conversation

miensol
Copy link
Contributor

@miensol miensol commented May 7, 2012

LocalCommandLineTask used WorkingDirectory to build ProcessStartInfo.FileName to be executed. I believe the ExecutableIsLocatedAt should be used instead.

@ferventcoder
Copy link
Member

We'll take a look and let you know. Thanks!

@drusellers
Copy link
Member

@miensol can you give me the story behind this change. It would break a lot of existing deployments that already use this behavior and I would like to not just break peoples deployments just because. Totally open to the idea, just want to hear the reasoning. :)

@miensol
Copy link
Contributor Author

miensol commented May 28, 2012

I was automating deployment of some legacy Windows service (not build with Topshelf). CommandLine option with InstallUtil.exe looked like a natural choice for this. InstallUtil.exe is of course located at .net framework installation directory (which is not part of PATH system variable). The install step look like this:

  s.CommandLine("InstallUtil")
    .ExecutableIsLocatedAt(@"c:\Windows\Microsoft.NET\Framework\v4.0.30319\")
    .Args(@"c:\path\to\legacy\service.exe");

The step failed during local deployment because it could not find InstallUtil. Then I looked through LocalCommandLineTask which has this reasonable behavior of deriving ExecutableIsLocatedAt from WorkingDirectory. This works great if the executable is at WorkingDirectory or at one of directories in PATH. However if one specified the executable location explicitly, like I did, it had no effect. What's more, a verify run apparently looks for the .exe in the ExecutableIsLocatedAt giving some false positives. I hope the test that I've written, named badly though, exposes this behavior.

@drusellers
Copy link
Member

this has been merged in 8c32217 - i needed to rebase it so it didn't auto close

@drusellers drusellers closed this Jul 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants