This plugin consumes entropy from the OS. You specify the length of the password, and then that amount of entropy is squashed into the default 62-character set (upper and lower-case alphanumerics) and returned on the stack.
Example usage:
NSIS plugin wiki page: http://nsis.sourceforge.net/Pwgen_plug-inpwgen::GeneratePassword 10
pop $0
MessageBox MB_OK "New password: $0"
The ZIP contains the binary, source, documentation and an example. I'm releasing this as Public Domain. Do with it as you please; no attribution required.