Posted: 31 May 2017 9:39 EDT Last activity: 23 Aug 2018 19:06 EDT
Extract folder was locked by another process Error Message
Some of our Runtime users are encountering this upon login. I've noticed it happens if the user does not properly shutdown Runtime or it crashes unexpectedly. I've tried ending any task manger process or service opened by OpenSpan, but the only work around I've seen is to restart the workstation.
Is there a best practice or guide to ensure Runtime has completely shutdown and unlocked the extract folder?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
It sounds like the solution might not be shutting down properly. If it is truly running, and the users are simply launching it a second time, then this error is expected. If they have shut down the solution properly, it would seem something is getting stuck.
I would approach this by first identifying what exactly is stuck. Is the solution not fully closing one of the applications? Would you please provide details on how you are triggering the shutdown of the solution? Are you calling the TerminateRuntime method in your automation? Once we determine what is stuck, we can add logic on shutdown to kill that process including and up to killing Runtime, but that is not usually necessary.
It would be best to get the shutdown properly working rather than try to kill the process on startup as that requires essentially creating a batch file to first terminate Runtime and any associated applications, and then launching the project. I have used the taskkill command to kill processes before launching in certain circumstances. The command would be;
taskkill /f /t /im "OpenSpan.Runtime.exe"
You could follow that up with the command to start OpenSpan.Runtime.
The shutdown is being triggered by the MDI window closing. I'm not able to reproduce the pop-up on my workstation, but from the User's side, I believe all the IE processes are closed as well. The user did mention, without restarting, the extract folder would be unlocked after about 30 minutes from the getting the initial pop-up.
Instead of calling Terminate Runtime on the MDI Window Closing event, can you alter it to trigger off of the adapter Stopped event (or if you are using MonitorAll as the StartMethod use the MDI window Closed event)? You may be causing a stuck thread by using the Closing event as that is synchronous to the window closing (i.e. it won't complete the thread until the window has closed completely). That may be the issue. If you are still having an issue, you might try adding a script like the attached to the end after calling TerminateRuntime to effectively kill the runtime.