.net - Accessing properties between calls using NSIS CLR.dll -
i writing installer using nsis needs parse block of json.
to achieve hoping able call .net dll parse json , in nsis script call properties on class retrieve data need.
however, appears nsis clr.dll has problem state of class not maintained between calls.
my test .net class follows:
namespace nsistestdll { public class testclass { private bool _configured; public void configure() { _configured = true; } public string name { { if (_configured) { return "john doe"; } return "unconfigured"; } } } } and part of nsis script calls is:
file "nsistestdll.dll" clr::call /nounload "nsistestdll.dll" "nsistestdll.testclass" "configure" 0 clr::call /nounload "nsistestdll.dll" "nsistestdll.testclass" get_name 0 pop $0 messagebox mb_ok $0 the messagebox shows "unconfigured" rather expected "john doe".
reading forum on clr.dll creater of plugin mention problem.
does know of workaround this?
one thing thinking of doing writing wrapper in c++ , using system.dll instead can pass needed values directly nsis script variables.
the other alternative parse json every property need retrieve, json small enough wouldn't impact performance badly.
in call clr::call /nounload ... /nounload applies clr dll (the plugin) clr plugin have invent/support it's own parameter if needed keep nsistestdll loaded
Comments
Post a Comment