Spawn Executable in A Fixlet

I am trying to start a process within a fixlet, but when the executable is run, the action is stuck in running state until the process is killed.

Is there a way to start a process and have it return back to Bigfix as complete?

I have tried to launch this process from a batch file and from action script with the same result.

You can use RUN instead of wait/waithidden.

https://developer.bigfix.com/action-script/reference/execution/run.html

1 Like

Agree, use ‘run’ instead of ‘wait’.

If this is for a file you are downloading in the action, be sure to copy it out of the __Downloads folder first and run it from the new location, do it doesn’t keep the download folder locked

I tried to spawn the DataCardUtilitiesServer.exe within a batch file, but couldn’t get that to work. So, I separated the launch of the executable and added the run command to the generated code. This worked! Thanks

override wait
hidden=true
completion=job
wait run.bat

// Launch Data Card Utility - custom because wouldn't work in run.bat - action hangs in running state. 

run "C:\Program Files\PhilipsRespironics\Care Orchestrator\Data Card Utilities\DataCardUtilitiesServer.exe"

In another fixlet with the same problem where the completion was not returning, I tried the following change which did not work.

override run
hidden=true
completion=job
run run.bat

I am using the Software Distribution Dashboard.

Here is what worked. I had to comment out the Exit code and Closing marker stuff because relevance substitution failed.

folder create "c:\Windows\temp"
delete "c:\Windows\temp\stamps64.exe"
copy "__Download\stamps64.exe" "c:\Windows\temp\stamps64.exe"
run "c:\Windows\temp\stamps64.exe" /s


//**Begin Closing Marker
// Get the return code of the previous action.
//parameter "returnCode" = "{exit code of action}"


// Task will now exit.
//exit {parameter "returnCode"}
//**End Closing Marker

That implies the ‘run.bat’ file may not have been created.

I believe run.bat was created. It is part of the standard SWD fixlet creation.

When you say ‘completion not returning’ do you mean that it installed but that the exit code was interpreted by BES as other than success? That certainly can happen, SWD fixlets by default pass whatever the installer outputs to stderr, but a software developer decides what that is, and BES can’t know every weird thing that might get 2>&1’d, so it really only reliably works with msiexec let’s be real.

By default the ‘wait’ command spawns a child process, waits for the process to complete, and provides the process return code back to the BES Client where it can be referenced as ‘exit code of action’.

In contrast ‘run’, by default, creates a new detached process, does not wait for the process to complete, and continues running the next ActionScript command (or completing the action) while the spawned process may continue running in the background. When using the ‘run’ method we do not have access to the spawned process’ return code (and in fact that process might still be running after the Action completes).

I’d have to check the behavior in your instance, though, as you are overriding the defaults with the ‘override’ command. I’m not certain of the behavior of ‘run’ with ‘completion=job’. I’m also not sure I understand from your posting which behavior you are seeing, and what behavior you expect to see.