Skip to content
⌘ NSIS Forum Archive

About Plugins

23 posts

kike_velez#

About Plugins

Hello

I know that these are questions too generals but ...

a)Is better to do the plugins with c or with c++ or is indiferent ?

b)The plugins in plugins/contrib have the files *.dsp and *.dsw . I think that these are files of Visual C++ . Is better to use it?

c)Whats compiler is better to use ? Dev-c++, lcc32, visual c++ ...?

Thanks in advance
Joel#
a) Whatever, dude 😛 .... but if you are in c++, remember to add the extern "C" thingy...

b) Visual Studio 4 and up (even .NET) can handle them... I think Dev-C++ use it as project converter...

c) Most of the source code are in Visual Studio 6 nor .NET. but you can open the the files (.c, .cpp, .h) in other IDEs and change whatever you need to change.... of course you need to know the syntax of the compiler.... for example MinGW, which comes in DEv-C++,isn't 100% compatible with the Visual C++ syntax.... <_<
kichik#
The Microsoft compiler produces smaller executables. You can use the new free toolkit in combination with the Platform SDK.
kike_velez#
Thanks a lot 👍

@kichik :: Your second link don´t work 🙁. Can you attach the link again? Thanks

BTW , The free toolkit can work with projects ? I thought that it can work only with a simple file (a limitation).


Thanks in advance
kichik#
Platform SDK - http://www.microsoft.com/msdownload/...sdk/sdkupdate/

I don't know if the toolkit works with project files, but nothing stops you from calling cl.exe on your own. cl.exe accepts more than one file.
kike_velez#
Hello again

I see the link and there´s "Windows XP SP2 Platform SDK" but this not talk about win95,win98,.. That would to say that if I do a plugin with this sdk this plugin wouldn´t be compatible with the others operative sistems (win95,win98)?.

Thanks in advance

Note :: Sorry if this is an trivial question 🙁
kichik#
No, it doesn't mean it won't work on versions other than XP SP2. It simply means it contains the tools required to build applications that take advantage of the new features XP SP2 has to offer.
kike_velez#
Hello

I install the Visual C++ Toolkit 2003 and the SDK.
The configuration of the shortcut is:
Set PATH=C:\Archivos de programa\Microsoft Visual C++ Toolkit 2003\bin;%PATH%
Set INCLUDE=C:\Archivos de programa\Microsoft Visual C++ Toolkit 2003\include;%INCLUDE%
Set INCLUDE=%INCLUDE%;C:\Archivos de programa\Microsoft Platform SDK for Windows XP SP2\Include
Set LIB=C:\Archivos de programa\Microsoft Visual C++ Toolkit 2003\lib;%LIB%
Set LIB=%LIB%;C:\Archivos de programa\Microsoft Platform SDK for Windows XP SP2\lib 
But when I compile the exdll.c (with the exdll.h) I see this error:

With this sentence Cl exdll.c /LD

/out:exdll.dll
/dll
/implib:exdll.lib
exdll.obj
   Creating library exdll.lib and object exdll.exp
exdll.obj : error LNK2019: unresolved external symbol _
renced in function _myFunction
exdll.obj : error LNK2019: unresolved external symbol _
d in function _myFunction
exdll.dll : fatal error LNK1120: 2 unresolved externals 
a) What I am doing wrong?

b) The sentence is the correct? What´s the sentence to do the dll more fast, little and good?

The help of cl.exe (cl /?) is (see file attached).

Thanks in advance
kichik#
The error messages got trimmed, but according to the posted command line you've used, it seems you forgot to include a list of libraries to link to. In ExDLL's case, only kernel32.lib is needed. More complicated plug-ins may require more libraries.

To get the smallest plug-in possible you need some more switches. Below is an example of compiling the UserInfo plug-in with these switches:

cl /O1 UserInfo.c /LD kernel32.lib advapi32.lib /link /OPT:NOWIN98 /NODEFAULTLIB /ENTRY😁llMain
kike_velez#
Thanks for your reply but the errors continues .
With this sentence :

cl /O1 exdll.c /LD kernel32.lib

The errors are :

/out:exdll.dll
/dll
/implib:exdll.lib
exdll.obj
kernel32.lib
   Creating library exdll.lib and object exdll.exp
exdll.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 refe
renced in function _myFunction
exdll.obj : error LNK2019: unresolved external symbol __imp__wsprintfA reference
d in function _myFunction
exdll.dll : fatal error LNK1120: 2 unresolved externals 
Thanks in advance
kichik#
Use user32.lib too. For each error like that, go to MSDN and look for the "missing" API function. On the very bottom of the MSDN page, it says which library is required.
kike_velez#
😁 That works ¡¡¡

The correct sentece is :

cl /O1 exdll.c /LD /link kernel32.lib user32.lib

And creates a exdll.dll with 40kb. Is a normal size?

Thanks
kike_velez#
This works¡¡¡

cl /O1 exdll.c /LD /link kernel32.lib user32.lib /
OPT:NOWIN98 /NODEFAULTLIB /ENTRY😁llMain


And now have only 3kb¡¡¡

Thanks a lot
kike_velez#
This works¡¡¡

And now have only 3kb¡¡¡

cl /O1 exdll.c /LD /link kernel32.lib user32.lib /
OPT:NOWIN98 /NODEFAULTLIB /ENTRY😁llMain


Thanks a lot
Joel#
I also recomment C::B is an IDE for the Toolkit and is Open Source 😉

I'm testing it know and seems to working OK 👍
kike_velez#
I also recomment C::B is an IDE for the Toolkit and is Open Source
I use Eclipse vith the toolkit but i have not a debugger.
What about with C::B ?
kike_velez#
plugins for Windows and Linux

Hello

I know that the NSIS is port to Linux and BSD (I think).
Are there recomendations when we do plugins for that these can be useful on Windows or Linux machines ?

Best Regards
onad#
For your understanding, you can make ,as in produce, a WINDOWS installer (SETUP.EXE) via makensis on a POSIX system, e.g. Linux.

This is very handy if you do a nightly build of a Windows Installer on a POSIX system.

So, NSIS is NOT used for creating runnable installers which target the Linux client PC.

For a working makensis on Linux, see screenshots on Suse 9.3.

Yes, if you look closly the finished build installer runs, but under WINE, that's why 😉