Saving world get the relative plugin path converted to absoluted

Posted by Zhenzh on Wed 07 Feb 2018 06:16 AM — 5 posts, 23,057 views.

China #0
I manually modified .MCL file to get the world portable like this: <include name="./worlds\JHL\Plugin\Character_Information.xml" plugin="y" />

But I find the saving operation in mush automatically overwrites the relative path I provided, instead, converts it to an absolute path: <include name="E:\MUSHCLIENT\WORLDS\JHL\Plugin\Character_Information.xml" plugin="y" />

Which means each time I do the saving world operation, I have to manually modify the .MCL file to recover the relative plugin path

Is it possible to keep the relative plugin path in .MCL file?

Another problem is that the relative path uses startup directory, which means starting world by load MCL in much and directly running MCL file may get error because of different startup path.

Can I set the relative path using application install directory
Australia Forum Administrator #1
Would it be possible for you to use LoadPlugin to load the desired plugins?

http://www.gammon.com.au/scripts/doc.php?function=LoadPlugin

Then you could tweak the path that is loaded as desired. A small script to do that could be in your main (script) file.

You may need to unload all the plugins when saving the world (or closing the session), otherwise the absolute paths would be saved with the world file.


http://www.gammon.com.au/scripts/doc.php?function=UnloadPlugin
China #2
How to unload the plugin when saving the world or closing session?

Is manually operation required?
Australia Forum Administrator #3
Template:version
Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.


The current version of MUSHclient does in fact save plugins as relative paths. For example from one of my MCL files:


<!-- plugins -->
<include name="Omit_Blank_Lines.xml" plugin="y" />
<include name="Summary.xml" plugin="y" />
<include name="MUSHclient_Help.xml" plugin="y" />
<include name="Calculator.xml" plugin="y" />
<include name="Config_Option_Changer.xml" plugin="y" />
<include name="C:\program files\mushclient\worlds\plugins\Scrolling_Window_Demo.xml" plugin="y" />
</muclient>


You will notice that all but one plugin has a relative path. The only one that didn't was a plugin that was not currently in the default plugins directory.

Make sure your plugins are loaded from the worlds/plugins directory and it should work. Also make sure you have the latest version:

http://www.gammon.com.au/forum/index.php?bbtopic_id=1
Australia Forum Administrator #4
I notice when I look at my post above that the only difference in the last plugin was the "case" of the path, not the real path. I've amended the save code to do a case-insensitive check of the pathname.

https://github.com/nickgammon/mushclient/commit/95d4dcb

This new pre-release version should be available if you follow the instructions here:

http://www.gammon.com.au/forum/?id=13903