Opened 7 years ago

Closed 7 years ago

# [patch] TicketWorkflowOpRunExternal will only work with .exe files on Windows

Reported by: Owned by: anonymous retracile normal AdvancedTicketWorkflowPlugin normal run_external windows exe hju@… 0.11

### Description

When using TicketWorkflowOpRunExternal to call an external script, the script path does not specify a file extension.

This means that in Windows, you get a 'This file is not a valid Win32 application' error when the script is called because without a file extension Windows treats it as an executable (.exe) file and tries to run it as a Windows executable.

A workaround is to create an executable (.exe) instead of a script, which Windows can execute without specifying the extension.

A fix could be to specify the file extension in the workflow options like so:

<someaction>.operations = run_external
<someaction>.run_external = Hint to tell the user.
<someaction>.extension = vbs


If the extension option is not set then it would behave as it already does meaning unix users need not change anything.

### comment:1 follow-up: ↓ 2 Changed 7 years ago by chrisheller

You can actually create .bat or .cmd files (e.g. run_external.bat will work for the example above) which will let you do what you're looking for with creating an .exe for it.

### comment:2 in reply to: ↑ 1 Changed 7 years ago by hju@…

You can actually create .bat or .cmd files (e.g. run_external.bat will work for the example above) which will let you do what you're looking for with creating an .exe for it.

Sorry, but I'm not shure if I got your point.

<someaction>.operations = run_external.bat


is not working...

and

<someaction>.bat.operations = run_external


is no valid workflow action.

I face the same problem. Using a link for redirecting (as under unix) won't help because it is internally represented as <someaction>.lnk.

Perhaps a more general approach with an option in the ticket-section is easier to implement:

[ticket]


### comment:3 Changed 7 years ago by hju@…

• Summary changed from TicketWorkflowOpRunExternal will only work with .exe files on Windows to [patch] TicketWorkflowOpRunExternal will only work with .exe files on Windows

here is a small patch against this ticket working for me. It's using the new option advancedworkflow_scriptextension in ticket sektion of trac.ini

[ticket]


Note: the linenumbers of the patch may be different from the original code due to lots of patches implemented in my version of this plugin.

### Changed 7 years ago by hju@…

patch against ticket 5256

patch corrected

### comment:4 Changed 7 years ago by retracile

• Resolution set to fixed
• Status changed from new to closed

I decided to take a different approach in [7698]. Rather than add a config option, it now looks for <actionname>, <actionname>.exe, <actionname>.cmd, and <actionname>.bat in that order.

### comment:5 Changed 5 years ago by anonymous

• Cc chris.bennell@… removed