Modify

Opened 16 years ago

Closed 15 years ago

Last modified 14 years ago

#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)

advancedticketworkflowplugin-5256.diff (644 bytes) - added by hju@… 15 years ago.
patch against ticket 5256
advancedticketworkflowplugin-5256-2.diff (656 bytes) - added by hju@… 15 years ago.
patch corrected

Download all attachments as: .zip

Change History (7)

comment:1 Changed 16 years ago by Chris Heller

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 15 years ago by hju@…

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 hju@…

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 hju@…

patch against ticket 5256

Changed 15 years ago by hju@…

patch corrected

comment:4 Changed 15 years ago by Eli Carter

Resolution: fixed
Status: newclosed

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 anonymous

Cc: chris.bennell@… removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Eli Carter.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.