Search code examples
petrel

Is it possible to run Petrel in batch mode from a windows service?


Currently I have a plugin for Petrel that is used in batch mode. So Petrel is launched from the command line, with the class/method to run specified via command line parameters. All fairly straight forward.

However, I'd like this operation to be performed from a Windows service. Simple experimentation suggests this won't work due to Petrel needing to open a window and thus needing to be run from a logged in user account.

Is there a way around this, or is it impossible to run Petrel from a service?


Solution

  • You may be able to use PetrelEngine. It is normally used to launch Petrel in silent mode for automated testing, but I think it might work for you.

    PetrelEngine.Instance.Initialize("-licensePackage Package1");