Running an exe directly from sequencer

Questions, tips, information and discussions about using the SharpCap Sequencer and Sequence Planner tools
Post Reply
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Running an exe directly from sequencer

#1

Post by zerolatitude »

Idea is to start apps not natively supported in SC (eg Metaguide, MGDither, CdC etc) as part of a sequence.

I am currently doing this through a python script. i.e., use sequencer step "Run the python script in <script>" where the <script> has code to start an exe file.

Can it be done directly, that is, a sequencer step like "Run executable <filepathname>" ?

If not, any possibility of incorporating as a new sequencer step?

Thanks
User avatar
admin
Site Admin
Posts: 13174
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Running an exe directly from sequencer

#2

Post by admin »

Hi,

yes, this is in the 'Misc' section - 'Run <program to run> with arguments ...' - you can also specify whether the sequencer should wait for the program to exit or leave it running and carry on with other steps.

cheers,

Robin
zerolatitude
Posts: 156
Joined: Mon Mar 01, 2021 5:24 am

Re: Running an exe directly from sequencer

#3

Post by zerolatitude »

So it is. Now how did I miss that?

Thanks.
cveillet
Posts: 8
Joined: Tue Jul 25, 2023 11:50 pm

Re: Running an exe directly from sequencer

#4

Post by cveillet »

I am trying to use this "Run" command from the sequencer, but I am clearly missing something, as it does not work the way I thought it would be working...

I want to launch a script processing the data from a rapid burst of very short images once the sequence is done (a lot of data processing done mostly in python). For now, I am launching just a basic script to test if it works... Data processing has been already tested in stand alone mode.

I assume for now that the script will be launched from the PowerShell (though I have also a version using a PowerShell bash command to launch a Linux version, the latter working also directly from an Ubuntu window).

Options of the Run "Select Step Properties"
Program to run: C:\Data\RINGSS\python_code\test.ps1
Arguments: 2023-10-17 Vega

Feedback:
An error occurred trying to start process 'C:\Data\RINGSS\python_code\test.ps1' with working directory 'C:\Users\cveil\Downloads'. The specified executable is not a valid application for this OS platform.' while running step Run 'C:\Data\RINGSS\python_code\test.ps1' with parameters '2023-10-17 Vega' and wait for it to exit
12:41:25 PM End : Sequence halted due to error.

Thanks for any advice! SharpCap is great, especially the sequencer! I am for now stuck with not knowing how to make this "Run" step work...

Cheers from AZ,
Christian
User avatar
admin
Site Admin
Posts: 13174
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Running an exe directly from sequencer

#5

Post by admin »

Hi Christian,

from the text of the error message, I suspect that Windows is being reluctant to run the .ps1 file as a script. Probably the trick to fix this will be to actually change the step to run Powershell.exe directly - something like

Code: Select all

powershell -ep bypass C:\Data\RINGSS\python_code\test.ps1
The -ep bypass option stops Powershell from getting upset about being asked to run a script from file - may or may not be necessary.

cheers,

Robin
cveillet
Posts: 8
Joined: Tue Jul 25, 2023 11:50 pm

Re: Running an exe directly from sequencer

#6

Post by cveillet »

Thanks, Robin. It works! ;)

Code: Select all

RUN powershell WITH PARAMS "-ep bypass C:\Data\RINGSS\python_code\test.ps1 2023-10-17 Vega" WAIT True
It actually works with and without the -ep bypass option, so I'll just go without it.

Cheers!
Post Reply