We have IronPython scripts that need to behave differently depending on whether they're being called from web player or thick client. Before Spotfire v7, an IronPython script could determine whether it was running in web player as follows:
from System import Environment
isWebPlayer = Environment.CommandLine.Contains("w3wp.exe")
Starting with Spotfire v7, that no longer works, but the following works instead, as documented here:
from System import Environment
isWebPlayer = Environment.CommandLine.Contains("SpotFire.Dxp.Worker.Host.exe")
However, there's no commitment that this won't change in a future release. We have hundreds of deployed dxp files with scripts to do this check. Now that we're deploying Spotfire 7.x, I have to manually update the scripts in every file with the new check. I would like an officially supported API call that tells whether it's running web player or not, so that we won't have to do this manually updating again in the future.
@David I have no doubt of your need for this feature. My point is that is less likely to get the support of other customers/users as it's very specific to your needs. Hence less likely to be implemented. So just trying to be helpful/realist but couldn't see any other use for this hence my original question.
@Christian For you these may be edge cases and not common. For us they are used by hundreds of users daily. Perhaps we could re-architect our implementation to use web mashups to achieve a similar result. But I'd sure rather have a reliable API call that tells whether we're running in web player.
Ummm ok they sound like very edge cases and not common from what I have seen. A Web Mashup could remove pages too and will only be active on Web Player. Same applies for Windows forms.
There are 2 situations where I need different behavior in web player. The
first is when I want to hide parts of the analysis from web player users
because it's useless to them and therefore unnecessary clutter. To do
this, I have a script that deletes certain pages if it's running in web
player. The second situation is when a script uses functionality, like
Windows Forms, which is not available in web player. My script checks and
puts up a friendly alternative message when run from web player.
Why do you need to have IronPython scripts that need to behave differently depending on whether they're being called from web player or thick client?