[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Can't start hook script

From: Tim Hill <drtimhill_at_comcast.net>
Date: 2006-12-28 05:53:03 CET

No, I realize what you are doing. However, WSH scripts are not
executed "directly" by the Windows shell; they are run by the
cscript.exe or wscript.exe Windows applications. So when you run
"foo.wsf" you are really running cscript.exe (or wscript.exe) and
passing it "foo.wsf" as a command-line argument. This magic is
handled by the Windows shell with the help of the search path and
some environment variables. If either the search path or the
environment is wrong the magic will break and the script won't run.

You probably want to explicitly specify everything on the command
line. Something like:

c:\Windows\system32\cscript.exe //B //Nologo MyScript.wsf my-arguments

Aside from permissions and user account stuff, that should work fine.

--Tim

On Dec 27, 2006, at 6:10 PM, Andy Levy wrote:

> On 12/27/06, Tim Hill <drtimhill@comcast.net> wrote:
>> This is probably an environment thing; try dumping the environment to
>> see what you have to work with (you'll notice that PATH is pretty
>> limited).
>>
>> Make sure you explicitly invoke the WSF script by its full path name
>> *and* you do so via the full path to the "cscript.exe" shell (this is
>> the command that actually runs the WSH script).
>
> I think you're misunderstanding me. I am *not* calling the WSF from a
> batch file - I want to avoid doing this. Apache (via the Subversion
> modules) should be invoking pre-commit.wsf directly, but the message
> reported back to my clients (both TortoiseSVN and the Win32 Subversion
> standard CLI client) indicates that the script can't be "started".
>
> I assume, since the functionality is in the source, it's been tested
> (maybe that's a bad assumption) and it should "just work" - I'm hoping
> that the problem is in fact my environment.
>
> What I haven't done yet is check TaskMan to see if cscript.exe or
> wscript.exe appears in the task list when I do the commit; I'll check
> this in the morning when I'm back at work.
>
>> --Tim
>>
>> On Dec 27, 2006, at 2:03 PM, Andy Levy wrote:
>>
>> > I'm attempting to write a hook script using Windows Script Host.
>> > Running WinXP, Subversion 1.4.0, Apache 2.0.55.
>> >
>> > I have a pre-commit.wsf in place which, for the moment, just writes
>> > out the arguments passed into it to a file located in a directory
>> > which Everyone has full control over, then quits with exit code
>> 1 (I
>> > can send the script file if it'll help anyone).
>> >
>> > When I run the script on the command-line, it executes fine.
>> When run
>> > as an actual hook script, I get the following output from my
>> client:
>> >
>> > Adding: Code\Local\TestCode\hooks
>> > Error: Commit failed (details follow):
>> > Error: MERGE request failed on '/Repos/Test/Playgrounds/Andy'
>> > Error: Failed to start 'C:\Repositories/Test/hooks/pre-commit.wsf'
>> > hook
>> >
>> > Apache runs under the local system account and if I use a .bat file
>> > for my pre-commit hook, everything is fine. I'd like to avoid
>> having a
>> > .bat script that just turns around and calls a .wsf script [1],
>> > however. Based on the discussion here [2], I thought that WSF
>> scripts
>> > were supported "natively" by now, so I must be missing something
>> in my
>> > environment's setup.
>> >
>> > Unfortunately, it looks like there are very few people writing
>> hooks
>> > in Windows Script Host as Google searches aren't finding much. Any
>> > help is greatly appreciated.
>> >
>> > [1]: http://cs.ferncrk.com/blogs/stuart/archive/2006/03/19/
>> > subversion_revision_property_change_script.aspx
>> >
>> > [2]: http://svn.haxx.se/dev/archive-2006-03/0748.shtml
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> > For additional commands, e-mail: users-help@subversion.tigris.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Dec 28 05:53:21 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.