Old 29th July 2010, 10:34   #41
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Check the readme again. Tip: Use Exec not Wait.

Stu
Afrow UK is offline   Reply With Quote
Old 18th January 2011, 17:57   #42
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I have uploaded a new version of the plug-in.

* Added Unicode build (just noticed there was already a Unicode build in this thread but never mind - this version has been tested at least).
* Uses new plug-in API (/NOUNLOAD not necessary with /ASYNC).
* Added /DISABLEFSR switch to disable WOW64 file system redirection on Windows x64 for the internal ExecDos thread (the old version would fail if the executable was in system32).

http://nsis.sourceforge.net/ExecDos_plug-in

Stu
Afrow UK is offline   Reply With Quote
Old 5th September 2012, 21:22   #43
HaMsTeYr
Junior Member
 
Join Date: Feb 2006
Posts: 44
Afrow, I noticed that the log files are encoded in UTF-8. Is there anyway to change that to UTF16-LE?

I'm writing a piece of code at the moment, and I'm trying to read Unicode characters into the stack, via an external file. I'm using the NSIS Unicode build at the moment.

I have tried executing to function instead of out to log, but it seems that only outputting it out to the log keeps the Unicode characters as they are.

I can think of only a few ways to do this, like a FileRead that works for UTF-8 (Using FileRead screws up the characters, and FileReadUTF16LE is no better.)

Another alternative is to stick of course, with FileReadUTF16LE, but the file has to be encoded in UTF-16 LE as well, if not it also becomes a garbled mess.

I know it may seem like asking for much, but would you happen to know any way around this?
HaMsTeYr is offline   Reply With Quote
Old 13th April 2014, 05:56   #44
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Someone asked for an x64 build of the plug-in (included as ExecDos64.dll along with the 32-bit ANSI/Unicode builds). Built using latest plug-in API source from SVN. Tested using the NSIS x64 build from https://bitbucket.org/dgolub/nsis64.

http://nsis.sourceforge.net/ExecDos_plug-in

Stu
Afrow UK is offline   Reply With Quote
Old 13th October 2020, 18:35   #45
systracer
Junior Member
 
Join Date: Apr 2014
Posts: 16
Hi, in my tests ExecDos does not support unicode (ASCII is OK) using /tofunc. For example, I am making a cmd file with the following content:
Quote:
@echo Тестовое сообщение (Test message)
Quote:
ExecDos::exec '"$SYSDIR\cmd.exe" /c $EXEDIR\Test.cmd' "" "$EXEDIR\Test.txt"
Pop $0
Here Test.txt contains the correct encoding and the message can be read. And in what encoding the cmd file was, the result will be in this (I tried 866 and 1251).

But if I use the following code:
Quote:
Function Test
Pop $0
FileWrite $R0 '$0' ; or FileWriteUTF16LE /BOM
FunctionEnd

FileOpen $R0 "$EXEDIR\Test.txt" w
GetFunctionAddress $R1 Test
ExecDos::exec /tofunc '"$SYSDIR\cmd.exe" /c $EXEDIR\Test.cmd' "" $R1
Pop $0
FileClose $R0
The result is always bad.

Test.cmd is Windows 866:
1) FileWrite: "???????? ????????? (Test message)"
2) FileWriteUTF16LE /BOM: "メᆬ£¬ᆴᄁᆴᆬ £ᆴᆴᄀ←ᆬᆳᄄᆬ (Test message)"

Test.cmd is Windows 1251:
1) FileWrite: "???????? ????????? (Test message)"
2) FileWriteUTF16LE /BOM: "ᅭ¥￱￲○¬○¥ ￱○○£¥■│¥ (Test message)"

Please help fix the problem.
systracer is offline   Reply With Quote
Old 18th October 2020, 21:04   #46
systracer
Junior Member
 
Join Date: Apr 2014
Posts: 16
Is this plugin no longer supported? Unfortunately, I couldn't find a better plugin for transferring output to a function, and this one has problems with Unicode.
systracer is offline   Reply With Quote
Old 18th October 2020, 23:47   #47
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,336
What happens if you just use MessageBox in the Test callback? Is it correct?

What if you do cmd.exe /U /C ...?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th October 2020, 07:05   #48
systracer
Junior Member
 
Join Date: Apr 2014
Posts: 16
Anders, thanks for the answer!

Quote:
Test.cmd in Windows 866, cmd /c + MessageBox = "メᆬ£¬ᆴᄁᆴᆬ £ᆴᆴᄀ←ᆬᆳᄄᆬ (Test message)"
Test.cmd in Windows 866, cmd /u /c + MessageBox = "5AB>2>5 "
Test.cmd in Windows 1251, cmd /c + MessageBox = "ᅭ¥￱￲○¬○¥ ￱○○£¥■│¥ (Test message)"
Test.cmd in Windows 1251, cmd /u /c + MessageBox = "e%EQNBNE "
Test.cmd in Windows UTF8, cmd /c + MessageBox = "￐ᄁ￐ᄉ￑チ￑ツ￐ᄒ￐ᄇ￐ᄒ￐ᄉ ￑チ￐ᄒ￐ᄒ￐ᄆ￑ノ￐ᄉ￐ᄑ￐ᄌ￐ᄉ (Test message)"
Test.cmd in Windows UTF8, cmd /u /c + MessageBox = "h%2h%a%d%d%h%[%h%モ%h%[%h%a% "
systracer is offline   Reply With Quote
Old 19th October 2020, 14:32   #49
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,336
Testing with cmd is not ideal. I assume you are really going to execute a real application? Does this app write utf-16 to stdout? Or does it write using the active code page and you need the plug-in to convert?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th October 2020, 14:37   #50
systracer
Junior Member
 
Join Date: Apr 2014
Posts: 16
I work with cmd files, so I am giving them as an example. There is no problem without /tofunc, which is why I report this problem.
systracer is offline   Reply With Quote
Old 21st October 2020, 22:16   #51
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,336
The Unicode version of the plug-in is broken as far as I can tell.

Just by looking at the code, the only Unicode handling seems to be that the stdin string is converted from Unicode to CP_ACP and written to the pipe with WriteFile.

There is no handling of the output as far as I can tell.

You can try contacting the author. In the mean time, write it directly to a file instead.

Quote:
ExecDos::exec '"c:\UnicodeConTest.exe"' "" "$temp\outtmp.txt" ; UTF16-LE passes through untouched
The output when sent to the function or a window/details seems to be converted although I'm not sure where.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump