Archive: Unicode NSIS - Plugins Trouble


Unicode NSIS - Plugins Trouble
Hi everyone,

I am currently using the Unicode NSIS branch and need to get some of the ANSI plugins working within my installer.

I have been beavering away at trying to recompile/recode some existing plugins to get them working with Unicode NSIS.

The three in particular that I need to get working are

FontName - http://nsis.sourceforge.net/FontName_plug-in
ButtonEvent - http://nsis.sourceforge.net/ButtonEvent_plug-in
dialogsEx - http://nsis.sourceforge.net/Dialog****plug-in

Do you know are there unicode versions of these?

Alternatively does anyone know of any step by step documentation on NSIS plugin development as I seem to be getting the same errors when I try to build the solution in Visual Studio 2005?

I have using the Unicode pluginapi.h and pluginapi.lib files from the Unicode Plugin example when building.

1> Creating library .\Debug/ButtonEvent.lib and object .\Debug/ButtonEvent.exp
1>ButtonEvent.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "void __cdecl ExecNSISFunc(int)" (?ExecNSISFunc@@YAXH@Z)
1>ButtonEvent.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>ButtonEvent.obj : error LNK2001: unresolved external symbol __RTC_InitBase
1>ButtonEvent.obj : error LNK2019: unresolved external symbol _popstring@4 referenced in function _AddEventHandler
1>ButtonEvent.obj : error LNK2001: unresolved external symbol _g_variables
1>ButtonEvent.obj : error LNK2001: unresolved external symbol _g_stacktop
1>ButtonEvent.obj : error LNK2001: unresolved external symbol _g_stringsize
1>ButtonEvent.obj : error LNK2019: unresolved external symbol _pushstring@4 referenced in function _WhichButtonId
1>ButtonEvent.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _WhichButtonId
1>ButtonEvent.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _WhichButtonId
1>ButtonEvent.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function _WhichButtonId
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
1>.\Debug/ButtonEvent.dll : fatal error LNK1120: 12 unresolved externals

Apolologies for the massive post. Any help here would be greatly appreciated.


Hello,
I ported my plugin (MSSQL_OLEDB) to 64bit.
I am using VS2005 too.
I had to add pluginapi.c to the project instead of using pluginapi.lib (there were some problems with functions decoration, the unicode version is compiled with vs2008).
All char variables are to be defined TCHAR and all string functions must be modified to be Unicode aware (_sprintf_s or similar).
If the plugins uses VARIANT or similar it could be a little more tricky.
Feel free to check the source code of the plugin. That code works both for 32 and 64 bit.
Stefano


Thanks a million sgiustto. Ill give the pluginapi.c a try later.


Did you have any luck in recompiling 'DialogsEx' ?

I would be very interested in a unicode version.

thanx


The __RTC_CheckEsp and ___security_cookie stuff should be disabled, search the forum for threads about compiling with VS2005

g_stacktop and friends is in the .lib or one of the (nsis) plugin files, can't remember exactly where off the top of my head


DialogEx for Unicode can be found at http://www.fdos.org/win32/nsis/plugi...ialogsex.3.zip

For nsis plugins, generally disable all runtime checks, exceptions, etc, don't include default libs, then enable optimizations, link with pluginapi.c (in unicode nsis source), change most char to TCHAR, check for any calls to windows functions explicitly ending with A, they may be ok or may need to drop the A, wrap character and string constants with _T() or equiv, if it has exdll.h replace it with an include to pluginapi.h, either supply a mini-c-library or replace c library calls with the equiv from standard windows DLLs, eg #define strcpy lstrcpy; after some minor review & fixes, test to ensure everything works as expected and you will have a plugin that can be compiled as ANSI or (by defining UNICODE) as UNICODE.


Plug-in is lost ?
As I was searching for the source of the dialogex plug-in for the reason that (I think) I found a bug with the unicode version of ${InputPwdBox}.

I realized that the whole actual plug-in seems to be lost. I am just getting a 404 with either the above link from perditionC or the link from the nsis sourceforge plug-in page.

Can anybody confirm this ?

If so, does anybody have a copy of the source ?


http://nsis.sourceforge.net/mediawik...plugins_src.7z


Thanx for the ansi source
and to clarify, the (unicode) script I was using when I thought I found a bug, added the ansi version of the dialogex plug-in which was located in the scripts folder.

So that's solved, no bug.

Still, it's a bit odd that both the ansi & unicode version of this plug-in seem to be lost :(