#5256 closed defect (fixed)
[patch] TicketWorkflowOpRunExternal will only work with .exe files on Windows
Reported by: | anonymous | Owned by: | Eli Carter |
---|---|---|---|
Priority: | normal | Component: | AdvancedTicketWorkflowPlugin |
Severity: | normal | Keywords: | run_external windows exe |
Cc: | hju@… | Trac Release: | 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.
Attachments (2)
Change History (7)
comment:1 follow-up: 2 Changed 15 years ago by
comment:2 Changed 15 years ago by
Replying to 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.
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] advancedworkflow_hook_extension = bat
comment:3 Changed 15 years ago by
Cc: | hju@… added |
---|---|
Summary: | TicketWorkflowOpRunExternal will only work with .exe files on Windows → [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] advancedworkflow_scriptextension = .bat
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 15 years ago by
Attachment: | advancedticketworkflowplugin-5256.diff added |
---|
patch against ticket 5256
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → 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 14 years ago by
Cc: | chris.bennell@… removed |
---|
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.