Archive: system plugin


system plugin
does anyone have a working example of system::copy??

i have searched the forums and the archives and can find no examples.

any help would be appreciated.:)


Probably nobody here knows how to use it except brainsucker (author of System plugin), you have to wait him to answer or try to contact him by using PM Messages.


Seems like it's simply memcpy.

An example:

# allocate a buffer and put 'test string' in it
System::Call "*(&t${NSIS_MAX_STRLEN} 'test string') i .s"
Pop $0
# allocate another buffer, same size
System::Alloc ${NSIS_MAX_STRLEN}
Pop $1
# copy
System::Copy /${NSIS_MAX_STRLEN} $1 $0
# get string in $1 buffer
System::Call "*$1(&t${NSIS_MAX_STRLEN} .r2)"
System::Free $0
System::Free $1
# print result
DetailPrint $2


BTW, there is a bug with the size thing. If you don't specify a size, you must add another dummy character before the destination. Fixed in latest CVS version.

And another thing, there doesn't seem to be a way to get the automatic allocation result. It just allocates it, doesn't return anything.

Sincerely, I thought the "/SIZE" was really a parameter which "SIZE" didn't change. Oh, tricky System plugin, so difficult to understand...

Is extremelly better to do a simple StrCpy command than that code above. It is not used, and probably, you won't find this example nowhere else than this thread.


Copying that string was just an example, you can do other things with it.

The System plug-in is very useful, just a bit undocumented. I do still plan, as I promised to brainsucker, to update it.


thanks for that example kichik :)


Just echoing what Kichik said, System plugin is awesome. I was able to get around the 1024 character limits in InstallOptions droplist ListItem by using the System plugin.
Also, some cool stuff with Registry management etc.


Thanx, thanx, thanx! It is a great pleasure to return to NSIS forum after monthes and hear such a worm words... :)

Kichik: Nice thing (copy with automatic allocation) :)
May be we should leave it as documented feature? ;)