Modify

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#5256 closed defect (fixed)

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

Reported by: anonymous Owned by: retracile
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@… 5 years ago.
patch against ticket 5256
advancedticketworkflowplugin-5256-2.diff (656 bytes) - added by hju@… 5 years ago.
patch corrected

Download all attachments as: .zip

Change History (7)

comment:1 follow-up: Changed 5 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 5 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 5 years ago by hju@…

  • Cc hju@… added
  • 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]
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 5 years ago by hju@…

patch against ticket 5256

Changed 5 years ago by hju@…

patch corrected

comment:4 Changed 4 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 3 years ago by anonymous

  • Cc chris.bennell@… removed

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from retracile. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.