get path C:\Program Files\Servoy\application_server\

Hello,

Developing myplugin that will be exported to myplugin.jar and in it’s code it loads C:\Program Files\Servoy\application_server\plugins\myplugin\additional.jar

Usual layout in the application_server\plugins folder:
application_server\plugins\myplugin.jar
application_server\plugins\myplugin.jar.jnlp
application_server\plugins\myplugin\additional.jar

How can i read the path to C:\Program Files\Servoy\application_server\plugins\myplugin\ ?
As Servoy install dir might differ on other machines.

This part of the code does exactly what i need, but seems a bit clumsy:

	var f = plugins.file.convertToJSFile('deleteThisTempFile.txt')
	var i_occurrence = utils.stringPatternCount(f.getAbsoluteFile().getParent(), 'developer')
	var tillCut = utils.stringPosition(f.getAbsoluteFile().getParent(), 'developer', 0, i_occurrence)	
	
	var appServer = utils.stringLeft(f.getAbsoluteFile().getParent(), tillCut-1)+'application_server'
	application.output( 'appServerPath: ' + appServer )
	plugins.file.deleteFile(f)

Is there is a simpler way to reach C:\Program Files\Servoy\application_server\ path?

Regards

Beware that the code you use here is only working because you are using it in Developer, the c:/Program files/etc… you refer to here is located on the client side.

But why do you need to know the server path that contains the jars on the server?

This path doesn’t make sense for a client anyway, and the jars in /plugins are loaded on the client side + those declared in your jnlp are loaded also on the client side.

I can’t imagine any use case for that. Could you tell us what you are trying to achieve?