Archive: Plugin fails on other machines


Plugin fails on other machines
I have created a NSIS plugin using Visual Studio 2005. It works great on my XP system but on any other system it doesn't seem to be executed at all.

Does anyone have an experience similar to this?


Some more details:
- If I compile the plugins from the NSIS site the same thing happens. My system: fine ; others : no execution

- I have the Academic version of Visual Studio.

- No errors occure when the plugin seems to fail to execute. Except that later things in my NSIS script that depended on results from the plugin to work don't work.

- I have XP running in a Virtual PC on my machine as well. The DLLs I make work fine in this.

Some side questions:
- has anyone had much success with open source compilers with NSIS plugins?

- does the Academic version of Visual Studio somehow limit the dll code it produces to the creator machine?

- if I provided the code could someone else compile it and send me the resulting dll.


You should avoid msvcrt80 dependencies VS 2005 like to include. Replace vcrt calls with kernel functions (if any, wsprintf for example) or add your own functions (most of NSIS plug-ins include code for atoi variants). Tiny libc also helps sometimes. Or add MSCVRT redistributions to your package :) DependencyWalker (DEPENDS.EXE) can help to check situation.


Further to Takhir's comment, the best place to run the Dependency Walker is on a plain vanilla installtion of Windows NT or Windows 2000. These operating systems include very old versions of the C runtime DLLs which VS2005 and VS2003 can't use. By running it on these systems, you will quickly see what your development PC has that your installation targets don't.

Also, make sure you have not selected the multi-threaded DLL support for the MSCRT - I did this in an early version of CABSetup and it took one of the senior developers at my work to point out what I had done; I wouldn't have guessed it in a million years!

Finally, check the MSDN to make sure that all of the functions your plugin uses are supported on your target platforms - some functions fail quietly or rely on you checking GetLastError.


I will try your suggestions. Thanks for being so responsive!


msvcrt shipped with Win95B (OSR2.5 to be specific) and will be present on the original version if IE4 or WinSock or any kind of update is installed (It is also present on the Win95A CD IIRC) so it is pretty safe to build with the multi-threaded DLL version of the CRT IMHO


BTW do not use debug build for distribution - msvcrtd.dll and mfc40d.dll will be absent in 99%! VS 6 is OK for most of Win versions (may be Win95 Gold not includes vcrt), but VS 2005 links to msvcrt80 and mfc80, and this is a problem almost everywhere.


I compiled using Visual Studio 2002 and everything worked great.

Thank you Microsoft for making life more complicated with progressive versions. Keeps things interesting. - Now with more productivity! Or not.