问题
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?
回答1:
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");
来源:https://stackoverflow.com/questions/24803393/is-it-possible-to-run-petrel-in-batch-mode-from-a-windows-service