Skip to content
⌘ NSIS Forum Archive

Unicode

573 posts

Animaether#
Well, Anders' 'MCIWndCreate' suggestion is at least correct - and it should load the file just fine.
A problem pops up getting it to actually play.. I have no idea what (combination of) flags 0x0465 is supposed to be.. but it's possible that it is an ANSI-specific (combination of) flags, with Unicode equivalents somewhere.

But eyeing the MCI docs at MSDN tells me that it's probably better to just send MCI_PLAY for a simple single play anyway.

But just to take things from the top...

1. Your Script is setting the output path to $PLUGINSDIR, but you don't have InitPluginsDir anywhere before that. Add that first, just to be safe.

2. Your system call then tries to load your sound file from $TEMP... replace that with $PLUGINSDIR.

So now on to the actual commands... If you compile this as is, it will still say it can't find the file. That's because of using MCIWndCreate instead of MCIWndCreateW.

3. Replace MCIWndCreate with MCIWndCreateW

If you try now, you'll see that the file does get loaded okay, but it can't understand the "play" command ("The driver cannot recognize the specified command."). I don't know why not. But, as mentioned above, we can use MCI_PLAY instead.

4. Replace...
SendMessage $hmci 0x0465 0 "STR:play" 
with
  !define MCI_PLAY 0x806
  SendMessage $hmci ${MCI_PLAY} 0 0 
The sound file should then play.
MaGoth#
Originally Posted by Animaether View Post
Well, Anders' 'MCIWndCreate' suggestion is at least correct - and it should load the file just fine.
A problem pops up getting it to actually play.. I have no idea what (combination of) flags 0x0465 is supposed to be.. but it's possible that it is an ANSI-specific (combination of) flags, with Unicode equivalents somewhere.

But eyeing the MCI docs at MSDN tells me that it's probably better to just send MCI_PLAY for a simple single play anyway.

But just to take things from the top...


1. Your Script is setting the output path to $PLUGINSDIR, but you don't have InitPluginsDir anywhere before that. Add that first, just to be safe.

2. Your system call then tries to load your sound file from $TEMP... replace that with $PLUGINSDIR.

So now on to the actual commands... If you compile this as is, it will still say it can't find the file. That's because of using MCIWndCreate instead of MCIWndCreateW.

3. Replace MCIWndCreate with MCIWndCreateW

If you try now, you'll see that the file does get loaded okay, but it can't understand the "play" command ("The driver cannot recognize the specified command."). I don't know why not. But, as mentioned above, we can use MCI_PLAY instead.
Yes, oddly enough, but the function you need to write it with a "W".
MCI_PLAY - for me turned out to be useless, because I want to play multiple files at once. 🙄

1,2. It was just an example, but even using his program itself finds the necessary files. 😉

4. Replace...
SendMessage $hmci 0x0465 0 "STR:play" 
with
  !define MCI_PLAY 0x806
  SendMessage $hmci ${MCI_PLAY} 0 0 
The sound file should then play.
This code is not useful for me.
But for the code change sound driver, thank you very much. I have changed a bit your code, using only the 0x806, and now I have everything works fine. 😛


@Animaether, Anders:
Thank you guys. 👍


MfG MaGoth, WoG.ru-Community.
MaGoth#edited
Greetings, 🙂
I have a small problem appeared again. Use this one plug-in for creating additional buttons with the conclusion of the message box:


Also, changed the file "modern.exe", adding to the 105-th section of the last row of the following:
   CONTROL "", 1190, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 201, 50, 14 
Example script:
!include "MUI.nsh"
 !include "LogicLib.nsh"
 !define IDC_BUTTON_TRYME 1190
 Name "ButtonEvent Example"
 OutFile "ButtonEventMUI.exe"
 !define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesShow
 !insertmacro MUI_PAGE_INSTFILES
 !insertmacro MUI_LANGUAGE "English"
 Function TryMe
  MessageBox MB_OK "Bla-Bla-blaaaa"
    Abort
 FunctionEnd
 Function InstFilesShow
  GetFunctionAddress $R0 TryMe
  ButtonEvent::AddEventHandler /NOUNLOAD ${IDC_BUTTON_TRYME} $R0
  GetDlgItem $R0 $HWNDPARENT ${IDC_BUTTON_TRYME}
  SendMessage $R0 ${WM_SETTEXT} 0 "STR:Info"
  EnableWindow $R0 1
 FunctionEnd
 Function .onGUIEnd
  ButtonEvent::Unload
 FunctionEnd
 Section "Dummy" SecDummy
  Sleep 1000
 SectionEnd 
When you compile a version Nsis ANSI message when you click on the button displayed.
When you compile a version Nsis UNICOD, no message, although compilation is successful.

Can somebody adapt this plugin version ANSI to UNICODE?! 🙄

Ps. Sorry for my dablpost.


MfG MaGoth, WoG.ru-Community.
noisebar#
String returned from install location text box

I think the string returned from the install location text box used to be UTF16. But now it seems to be UTF8. Is this assumption correct?
greenh#
compilation problem

uname -a
FreeBSD nw3 7.3-STABLE FreeBSD 7.3-STABLE #0: Fri Oct 15 18:26:08 MSD 2010 root@nw3:/usr/src/sys/i386/compile/GREENH i386
nsis unicode nsis-2.45.1 and 2.46
# scons
scons: Reading SConscript files ...

scons: warning: Ignoring missing SConscript 'SCons/utils.py'
File "/root/nsis3/SConstruct", line 79, in <module>

scons: warning: Ignoring missing SConscript 'SCons/config.py'
File "/root/nsis3/SConstruct", line 98, in <module>
KeyError: 'NSIS_CPPDEFINES':
File "/root/nsis3/SConstruct", line 122:
if 'NSIS_CONFIG_CONST_DATA_PATH' in defenv['NSIS_CPPDEFINES']:
File "/usr/local/lib/scons-1.3.0/SCons/Environment.py", line 411:
return self._dict[key]
files SCons/utils.py and SCons/config.py - exist
help me pls. What can it be?
taralex#
My HwInfo plugin returns junk now that I switched to unicode. is there a unicode build of HwInfo available?
MSG#
I don't know if there's a unicode version, but have you tried using the CallAnsiPlugin plug-in?
taralex#
no, but I solved that by writing my own .net dll, where getting this info is pretty easy.
Had to modify this plug-in to make it work with Unicode though. Added a link to the modified version to the Viki page.
MSG#
Mind you that using .NET requires .NET to be installed. Your installer would never work on any of my PC's.
taralex#
the product I'm installing requires .net 2.0, so I check for that first thing in the install and install it if it's not there.
mrphantuan#
7-zip expects a very specific format from the installer. One of its assumptions is that the string table is saved as ANSI. It's not such a faulty assumption when you add in the no-real-nsis-binary-specification factor.


___________________
my name: mrTuan|My site:du hoc my
noisebar#
Hey guys,

Does anyone of you might know where I can find the source code for unicode build version 2.35? It's the version we are currently using. Unfortunately, it has the PCA problem. We don't really want to spend the time upgrading to newer version because it's working fine for us except for this one problem. So we'd like to just apply the manifest change and rebuild NSIS. But it seems that all the history got lost when the source code repository was moved to Google Code. You can only get version 2.46 from there. So I'd really appreciate if somebody still has the source code for 2.35.
Afrow UK#
I see no reason to keep using that version. Upgrading takes a couple of seconds and you are guaranteed backwards compatibility unless you have modified NSIS's own files yourself.

Stu
Anders#
Originally Posted by Afrow UK View Post
I see no reason to keep using that version. Upgrading takes a couple of seconds and you are guaranteed backwards compatibility unless you have modified NSIS's own files yourself.

Stu
The old versions will compile with vc6, the new versions do not
mzd#
Logging support for Unicode version

Hello,

Thank you for this port. I am interested in enableing logging using LogSet and then logging using LogText. It seems that the Unicode distributions don't turn on logging. The non-unicode distributions have a "special build" for makenisis which has logging enabled. Is there a similar "special build" with logging enabled for the unicode port?

Thanks,

mzd
mrphantuan#
@Wizou: If you check my BgWorker plugin, you can see that I'm checking for kernel32::lstrcatW in the import table.

I also have some sample code in there that checks $pluginsdir, but like you said, you don't know the offset, so it has to use IsBadReadPtr() and there could be false positives.

Unfortunately, it turns out that writing hybrid plugins is a huge pain in the ass, and I can't recommend doing it on anything except very simple plugins





_______________

[ADMIN EDIT]
Warning: Spam(?) links removed!
Wizou#
@mrphantuan: I don't know which post you are referring to exactly..
However, regarding hybrid ANSI/Unicode plugins, I have changed my mind and consider it now also a bad idea to try to create such plugins.
And so I don't plan anymore on committing a plugin API that would work transparently with ANSI & Unicode.
It is just simpler for plugin author to build 2 separate DLL variant, one for ANSI, one for Unicode.

And my recommendation for compatibility with Unicode NSIS automatic plugin variant detection, is to name the ANSI version "MyPlugin.dll" and the Unicode version "MyPluginW.dll" and offer them in the same folder.
Anders#
Originally Posted by Wizou View Post
@mrphantuan: I don't know which post you are referring to exactly..
I believe that is something I posted, why he posted it now, I have no idea.

And yes, a single dll for both versions is possible, but just to much work in practice, just use TCHAR and compile two versions...
mzd#
Logging support for unicode version

Hello All,

I appears to me that all queries regarding logging support in the unicode port are being ignored. So, here goes again: is there any support for logging using LogSet in the unicode port. I have not yet understood the motivation behind turning off such a basic feature in any scripting language and especially in an install tool.

Thanks,

-mzd
Afrow UK#
It is turned off because it adds extra overhead to the installer. You'll have wait for kichik or someone with greater knowledge of the internals of NSIS to explain why such a feature cannot be toggled dynamically at installer compile time though. Perhaps when logging was implemented the developers didn't think of allowing dynamic enabling, or that the amount of work required was unnecessary. Sometimes using C compile time directives (#if ... #endif) with separate builds of a product is much simpler. Now that the code base is so large it'd probably be a lot of work to change now.

Edit: When the next version of NSIS is released which is Unicode, you will have a logging build then (http://nsis.sf.net/Special_Builds). For now you will just have to rebuild. You just need to install a few things to build; nothing that will cost you anything.

Stu
mzd#
@afrowuk.

Appreciate the response. Rebuild is an option, but not for me, since I don't own the build tools. The NSIS distribution is shared with other products and I am not at liberty to replace it with a custom build. It needs to be a published release ( a published special build distribution is ok ).

You mentioned that the next version of NSIS will be unicode enabled. Is that 2.47+?
Any insights in to the timeframe? Anyway, these are queries for the general NSIS Discussion forum.

Thanks,

-mzd
DrO#
Originally Posted by mzd View Post
It needs to be a published release ( a published special build distribution is ok ).
as this unicode build isn't really an official version then it's not too surprising no logging version was offered and would assume that any 'official' unicode versions would have a logging version providing along with the large string version (unless plans, etc have changed in that respect).

Originally Posted by mzd View Post
You mentioned that the next version of NSIS will be unicode enabled. Is that 2.47+? Any insights in to the timeframe?
it looks like it'd be 2.50 based on what's in cvs / help docs though i guess that might change and i think the timeframe is when it's done and ready. as work keeps starting / stopping on it, things seem to be taking longer than i guess it was hoped to have been.

-daz
Anders#
Originally Posted by DrO View Post
it looks like it'd be 2.50 based on what's in cvs / help docs...
I think that number was just a placeholder used by the fork
pabs#
status?

Whats the status of the Unicode support in SVN?

Actually, what is the status of SVN itself, right now I can't even seem to build makensis from SVN on Linux, it complains about tchar.h being missing.
jimpark#
mzd, sorry about not replying to this forum earlier. For some reason, my auto notification to a new message got lost. I just uploaded a logging version for you. You should see it in the download section of www.scratchpaper.com.
Anders#
Originally Posted by pabs View Post
Whats the status of the Unicode support in SVN?

Actually, what is the status of SVN itself, right now I can't even seem to build makensis from SVN on Linux, it complains about tchar.h being missing.
Nobody has touched the unicode stuff in a while, don't get your hopes up about this ever getting fixed. (You might be able to compile with VS2005+, otherwise you are out of luck)