Old 10th October 2013, 18:44   #41
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I noticed that WCHAR is typedef'ed unsigned short in Platform.h. Apparently these two can be directly type-cast with no problems, though I don't know the truth.

Quote:
#if !defined(_NATIVE_WCHAR_T_DEFINED)
typedef unsigned short WCHAR;
#else
typedef wchar_t WCHAR;
#endif

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile

Last edited by JasonFriday13; 10th October 2013 at 20:07.
JasonFriday13 is offline   Reply With Quote
Old 10th October 2013, 20:40   #42
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Quote:
Originally Posted by JasonFriday13 View Post
I noticed that WCHAR is typedef'ed unsigned short in Platform.h. Apparently these two can be directly type-cast with no problems, though I don't know the truth.
Yes but I believe it really is there just for the exehead stuff, you should not be calling the wcs* string functions with a WCHAR* parameter in makensis code (Not portable)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th October 2013, 04:14   #43
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I've had enough for now. I don't know if windows is smart and knows about the implied cast-typing, but gcc sure doesn't and it catches every type problem, which makes it very hard to troubleshoot. I might start on the non unicode version first as that seems easier to get change it around between ansi and unicode versions.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 11th October 2013, 14:21   #44
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
The ANSI version is going to have even more issues so I don't think that is a good idea. What about the diff I sent you?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th October 2013, 04:36   #45
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I applied that patch to a fresh 3.0a1 source (compiling with unicode on) and it's getting better, DialogTemplate.cpp compiles with no errors now. Also I have to remove 'ExDLL' from the lib_plugins list in Sconstruct, because it tries compiling pluginapi.c, which of course includes windows.h and throws an error about not finding it.

I am now getting another error in ResourceEditor.cpp, in:
return UpdateResourceW(szType, MAKEINTRESOURCEW(szName), wLanguage, lpData, dwSize);
saying "no type conversion found for argument 1". So I added this function to convert it:
Quote:
return UpdateResourceW(WinWStrDupFromTChar(szType), MAKEINTRESOURCEW(szName), wLanguage, lpData, dwSize);
I did this to the four "Resource" functions, and there are no errors there now. Also I changed this function call at line 985 to:
Quote:
return WinWStrLen(m_szName); // wcslen(m_szName);
which cleared up that error.

I am getting one error for this file still (other files don't compile if there are errors):
Quote:
Source/ResourceEditor.cpp: In member function 'int CResourceDirectory::Find(const WCHAR*)':
Source/ResourceEditor.cpp:865:40: error: '_wtoi' was not declared in this scope
I'll look around for alternatives for that function.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th October 2013, 05:08   #46
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Calling WinWStrDupFromTChar like that is a memory leak but its fine for testing.

There is probably something like myatoi in util.c or one of the plugin files, use it to create a WinWStrToInt in winchar.cpp/h if you cannot come up with anything else. I'll try to take a look at the code tonight...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th October 2013, 07:50   #47
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
There is, it's in "source/exehead/util.c", so I copied it over into "winchar.c" and renamed it like this:
Quote:
#ifndef _WIN32 // existing #ifdef
int WinWStrToInt(const WINWCHAR *s)
{
unsigned int v=0;
int sign=1; // sign of positive
TCHAR m=10; // base of 10
TCHAR t=_T('9'); // cap top of numbers at 9

if (*s == _T('-'))
{
s++; //skip over -
sign=-1; // sign flip
}

if (*s == _T('0'))
{
s++; // skip over 0
if (s[0] >= _T('0') && s[0] <= _T('7'))
{
m=8; // base of 8
t=_T('7'); // cap top at 7
}
if ((s[0] & ~0x20) == _T('X'))
{
m=16; // base of 16
s++; // advance over 'x'
}
}

for (;; )
{
int c=*s++;
if (c >= _T('0') && c <= t) c-=_T('0');
// clever little trick to do both upper and lowercase A-F.
else if (m==16 && (c & ~0x20) >= _T('A') && (c & ~0x20) <= _T('F')) c = (c & 7) + 9;
else break;
v*=m;
v+=c;
}
return ((int)v)*sign;
}
I added it to the header and to ResourceEditor.cpp, and it compiles. I hope it actually works.

Now I'm getting this error:
Quote:
In file included from Source/ResourceVersionInfo.h:30:0,
from Source/ResourceVersionInfo.cpp:19:
Source/strlist.h: In member function 'int SortedStringListND<T>::find(const TCHAR*, int, int, int, int*)':
Source/strlist.h:402:38: error: there are no arguments to '_wcsicmp' that depend on a template parameter, so a declaration of '_wcsicmp' must be available [-fpermissive]
Source/strlist.h:402:38: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
It comes up a few times. This is one of the code parts the function refers to in "strlist.h":
Quote:
if (case_sensitive)
res = _tcscmp(str, pCurr);
else
res = _tcsicmp(str, pCurr);
It's weird how it's brother "_wcscmp" is declared, but "_wcsicmp" is not declared in this scope. There are also some "'_swprintf' was not declared in this scope" errors, I would change these to "wsprintf", but is this a good function or should a different one be used?

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th October 2013, 08:17   #48
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
What about adding "|| !defined _WIN32" to line 53 in tchar.h? Because swprintf is recongnised under linux.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th October 2013, 13:07   #49
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I also noticed on linux, swprintf also requires a max length argument:
Quote:
int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...);
I quick dodgied the code (with #warning tags for stuff I changed or removed) to see what other errors I got, and it looks like build.cpp has lots of errors there. Also I had to comment out line 246 in Sconstruct because "tchar.h" doesn't exist in the build directory. And all the TEXT() macros that are in the source files I have been changing to _T(), because that is supported under linux.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 12th October 2013, 19:23   #50
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
The *icmp stuff is not really part of the standard, the string support sucks.

Here is another diff, should probably apply it to svn trunk and not alpha 1 if you can.

Not sure what to do about swprintf, I'll have to think about it some more...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th October 2013, 04:11   #51
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
you could try this
Quote:
#ifndef _WIN32
int swprintf(wchar_t*buf, const wchar_t*fmt, ...) // non-standard overloaded version for MSVC compatibility
{
va_list val;
va_start(val, fmt);
int res = vswprintf(buf, -1, fmt, val);
va_end(val);
return res;
}
#endif

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th October 2013, 08:53   #52
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
So went and downloaded the trunk source-tree, and added both of those diff's you gave me to a fresh copy.

I put that function into "Source/util.cpp" and it's prototype in "Source/util.h", it still gave a compile error saying it's undeclared, so I changed line 53 in "tchar.h" to
Quote:
#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__) || !defined _WIN32
and it compiles without an error.

So far these are the files that are compiling successfully (in this order):
Quote:
scons: Cleaning targets ...
Removed build/urelease/halibut/biblio.o
Removed build/urelease/halibut/bk_xhtml.o
Removed build/urelease/halibut/contents.o
Removed build/urelease/halibut/error.o
Removed build/urelease/halibut/help.o
Removed build/urelease/halibut/index.o
Removed build/urelease/halibut/input.o
Removed build/urelease/halibut/keywords.o
Removed build/urelease/halibut/licence.o
Removed build/urelease/halibut/main.o
Removed build/urelease/halibut/malloc.o
Removed build/urelease/halibut/misc.o
Removed build/urelease/halibut/style.o
Removed build/urelease/halibut/tree234.o
Removed build/urelease/halibut/ustring.o
Removed build/urelease/halibut/version.o
Removed build/urelease/halibut/halibut
Removed build/urelease/Docs/html/IndexPage.html
Removed build/urelease/Docs/html/Contents.html
Removed build/urelease/Docs/html/Chapter1.html
Removed build/urelease/Docs/html/Chapter2.html
Removed build/urelease/Docs/html/Chapter3.html
Removed build/urelease/Docs/html/Chapter4.html
Removed build/urelease/Docs/html/Chapter5.html
Removed build/urelease/Docs/html/AppendixA.html
Removed build/urelease/Docs/html/AppendixB.html
Removed build/urelease/Docs/html/AppendixC.html
Removed build/urelease/Docs/html/AppendixD.html
Removed build/urelease/Docs/html/AppendixE.html
Removed build/urelease/Docs/html/AppendixF.html
Removed build/urelease/Docs/html/AppendixG.html
Removed build/urelease/Docs/html/AppendixH.html
Removed build/urelease/Docs/html/AppendixI.html
Removed build/urelease/makensis/7zip/7zGuids.o
Removed build/urelease/makensis/7zip/7zip/Common/OutBuffer.o
Removed build/urelease/makensis/7zip/7zip/Common/StreamUtils.o
Removed build/urelease/makensis/7zip/7zip/Compress/LZ/LZInWindow.o
Removed build/urelease/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o
Removed build/urelease/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o
Removed build/urelease/makensis/7zip/Common/Alloc.o
Removed build/urelease/makensis/7zip/Common/CRC.o
Removed build/urelease/makensis/DialogTemplate.o
Removed build/urelease/makensis/Plugins.o
Removed build/urelease/makensis/ResourceEditor.o
Removed build/urelease/makensis/ResourceVersionInfo.o
Removed build/urelease/makensis/ShConstants.o
scons: done cleaning targets.
Next on the fail list is build.cpp, which gives all these errors (I combed out the duplicates to save some space):
Quote:
g++ -o build/urelease/makensis/build.o -c -Wno-non-virtual-dtor -Wall -O2 -DNSISCALL="__attribute__((__stdcall__))" -D_UNICODE -DUNICODE -DMAKENSIS -D_WIN32_IE=0x0500 -Ibuild/urelease/config Source/build.cpp
Source/build.cpp: In member function 'void CEXEBuild::initialize(const TCHAR*)':
Source/build.cpp:388:44: error: '_wgetenv' was not declared in this scope
Source/build.cpp:394:16: error: invalid conversion from 'const char*' to 'wchar_t' [-fpermissive]
/usr/include/c++/4.6/bits/basic_string.h:560:7: error: initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>, _Alloc = std::allocator<wchar_t>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<wchar_t>]' [-fpermissive]
Source/build.cpp: In member function 'int CEXEBuild::add_string(const TCHAR*, int, UINT)':
Source/build.cpp:487:33: error: '_wcsdup' was not declared in this scope
Source/build.cpp: In function 'char* convert_processed_string_to_ansi(char*, const TCHAR*, WORD)':
Source/build.cpp:533:90: error: cannot convert 'const TCHAR* {aka const wchar_t*}' to 'LPCWSTR {aka const short unsigned int*}' for argument '3' to 'int WideCharToMultiByte(UINT, DWORD, LPCWSTR, int, LPSTR, int, LPCSTR, LPBOOL)'
Source/build.cpp:543:34: error: 'LOBYTE' was not declared in this scope
Source/build.cpp:544:34: error: 'HIBYTE' was not declared in this scope
Source/build.cpp: In member function 'int CEXEBuild::preprocess_string(TCHAR*, const TCHAR*, WORD)':
Source/build.cpp:655:69: error: 'MAKEWORD' was not declared in this scope
Source/build.cpp: In member function 'int CEXEBuild::add_label(const TCHAR*)':
Source/build.cpp: In member function 'int CEXEBuild::resolve_jump_int(const TCHAR*, int*, int, int, int)':
Source/build.cpp:1364:29: error: '_wtoi' was not declared in this scope
Source/build.cpp: In member function 'int CEXEBuild::AddVersionInfo()':
Source/build.cpp:1816:112: error: no matching function for call to 'CResourceEditor::UpdateResource(LPSTR, int, LANGID&, BYTE*, int)'
Source/build.cpp:1816:112: note: candidate is:
Source/ResourceEditor.h:117:9: note: bool CResourceEditor::UpdateResource(const TCHAR*, WORD, LANGID, BYTE*, DWORD)
Source/ResourceEditor.h:117:9: note: no known conversion for argument 1 from 'LPSTR {aka char*}' to 'const TCHAR* {aka const wchar_t*}'
Source/build.cpp: In member function 'int CEXEBuild::ProcessPages()':
Source/build.cpp:2186:10: error: no matching function for call to 'CResourceEditor::GetResource(LPSTR, int, int)'
Source/build.cpp:2186:10: note: candidate is:
Source/ResourceEditor.h:118:9: note: BYTE* CResourceEditor::GetResource(const TCHAR*, WORD, LANGID)
Source/ResourceEditor.h:118:9: note: no known conversion for argument 1 from 'LPSTR {aka char*}' to 'const TCHAR* {aka const wchar_t*}'
Source/build.cpp: In member function 'int CEXEBuild::pack_exe_header()':
Source/build.cpp:2505:28: error: '_wremove' was not declared in this scope
Source/build.cpp:2511:26: error: '_wremove' was not declared in this scope
Source/build.cpp: In member function 'int CEXEBuild::write_output()':
Source/build.cpp:2947:7: error: 'LPTSTR' was not declared in this scope
Source/build.cpp:2947:14: error: expected ';' before 'cmdstr'
Source/build.cpp:2948:14: error: expected ';' before 'arg'
Source/build.cpp:2949:11: error: 'arg' was not declared in this scope
Source/build.cpp:2952:9: error: 'cmdstrbuf' was not declared in this scope
Source/build.cpp:2952:30: error: expected ';' before 'malloc'
Source/build.cpp:2958:47: error: 'cmdstr' was not declared in this scope
Source/build.cpp:2965:49: error: 'cmdstr' was not declared in this scope
Source/build.cpp:2974:12: error: 'cmdstrbuf' was not declared in this scope
scons: *** [build/urelease/makensis/build.o] Error 1
scons: building terminated because of errors.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 13th October 2013, 22:27   #53
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
This should contain all fixes so far except swprintf.


Quote:
because "tchar.h" doesn't exist in the build directory.
I don't really know what this means. nsis-version.h?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 14th October 2013, 01:19   #54
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Yeah, Sconstruct writes "#include "tchar.h"" into "nsis-version.h", but tchar.h is in the source directory, not the current directory ("build/urelease/config").

I'll add that patch now and get back to you.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 14th October 2013, 04:54   #55
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
So I added that patch you gave me, and I had to add #include "tchar.h" and #include "utf.h" to "ResourceVersionInfo.cpp" for it to compile with no errors.

That Sconstruct patch has caused a problem, these two lines:
Quote:
defenv.Append(NSIS_CPPDEFINES = [('PREFIX_CONF', 'L"%s"' % defenv.subst('$PREFIX_CONF'))])
defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DATA', 'L"%s"' % defenv.subst('$PREFIX_DATA'))])
gives this as it's output in "nsis-defines.h":
Quote:
definedlist.add(_T("PREFIX_CONF"), _T("L"/usr/local/etc""));
definedlist.add(_T("PREFIX_DATA"), _T("L"/usr/local/share/nsis""));
Which of course causes a few compiler errors.
I'm still getting these errors in build.cpp (I combed the duplicates to save space):
Quote:
Source/build.cpp:1816:112: error: no matching function for call to 'CResourceEditor::UpdateResource(LPSTR, int, LANGID&, BYTE*, int)'
Source/build.cpp:1816:112: note: candidate is:
Source/ResourceEditor.h:117:9: note: bool CResourceEditor::UpdateResource(const TCHAR*, WORD, LANGID, BYTE*, DWORD)
Source/ResourceEditor.h:117:9: note: no known conversion for argument 1 from 'LPSTR {aka char*}' to 'const TCHAR* {aka const wchar_t*}'
Source/build.cpp:2186:10: error: no matching function for call to 'CResourceEditor::GetResource(LPSTR, int, int)'
Source/build.cpp:2186:10: note: candidate is:
Source/ResourceEditor.h:118:9: note: BYTE* CResourceEditor::GetResource(const TCHAR*, WORD, LANGID)
Source/ResourceEditor.h:118:9: note: no known conversion for argument 1 from 'LPSTR {aka char*}' to 'const TCHAR* {aka const wchar_t*}'
[edit] Turns out these are related to the MAKEINTRESOURCE macros in "Platform.h", and I've come up with a fix in "Platform.h" on line 491. The macro is basically a type-cast, so I just made up another that works for wchar_t (don't know if this will work at runtime though). The "D" suffix is obviously for 'define':
Quote:
#ifndef _UNICODE
# define MAKEINTRESOURCED MAKEINTRESOURCEA
#else
# define MAKEINTRESOURCED(i) ((wchar_t*)((ULONG_PTR)((WORD)(i))))
#endif

#ifndef RT_BITMAP
# define RT_BITMAP MAKEINTRESOURCED(2)
#endif
#ifndef RT_ICON
# define RT_ICON MAKEINTRESOURCED(3)
#endif
#ifndef RT_DIALOG
# define RT_DIALOG MAKEINTRESOURCED(5)
#endif
#ifndef RT_GROUP_ICON
# define RT_GROUP_ICON MAKEINTRESOURCED(14)
#endif
#ifndef RT_VERSION
# define RT_VERSION MAKEINTRESOURCED(16)
#endif

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile

Last edited by JasonFriday13; 14th October 2013 at 07:46.
JasonFriday13 is offline   Reply With Quote
Old 14th October 2013, 09:22   #56
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Oh and I managed to fix "pluginapi.c" from trying to compile on linux. I changed line 691 in Scontruct from this:
Quote:
for plugin in plugin_libs + plugins:
To this:
Quote:
for plugin in plugin_libs and plugins:

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 14th October 2013, 20:11   #57
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
New Diff, I believe I fixed the tchar.h path issue and maybe messed up something else

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th October 2013, 04:52   #58
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Yeah something else did mess up:
Quote:
In file included from Source/util.h:25:0,
from Source/DialogTemplate.cpp:21:
Source/ResourceEditor.h: In member function 'bool CResourceEditor::UpdateResource(const WCHAR*, WORD, LANGID, BYTE*, DWORD)':
Source/ResourceEditor.h:129:28: error: cast from 'const WCHAR* {aka const short unsigned int*}' to 'WORD {aka short unsigned int}' loses precision [-fpermissive]
Source/ResourceEditor.h: In member function 'BYTE* CResourceEditor::GetResource(const WCHAR*, WORD, LANGID)':
Source/ResourceEditor.h:134:25: error: cast from 'const WCHAR* {aka const short unsigned int*}' to 'WORD {aka short unsigned int}' loses precision [-fpermissive]

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 15th October 2013, 06:15   #59
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Also, the compile system stops on the first error encountered, so several files still need to be compiled. For one, I know "dirreader.cpp" will need it's function prototypes changed, and "script.cpp" isn't being compiled yet either, along with a few others like "lineparse.cpp" and "lang.cpp".

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 16th October 2013, 08:37   #60
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
I have also been working on some stuff and I have made a .txt file that should describe everything that's wrong (though I might have missed something) and a few minor fixes that I've done. It's over 1600 lines but 3/4 of it includes one of the patches you gave me.
Attached Files
File Type: zip nsis-code-6415-NSIS-trunk2_1-posix-errors-and-patches.zip (16.1 KB, 165 views)

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 13th November 2013, 07:39   #61
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
When I compile my existing projects with the new NSIS version 3.0a1, it prints only several lines in the output window of the editor. With the older version 2.46 this is different. I see a lot of prints during the whole compilation. Of course I don't read all of them, but this can give me information what the compiler is doing currently. My script is huge and it needs probably 7-8 minutes for compilation and without prints with V3.0a1, it looks that it hangs and I don't know when it will finish. So is this behavior expected? Can I enable the prints similar to V2.46?
TrifonovS is offline   Reply With Quote
Old 14th November 2013, 01:45   #62
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Quote:
Originally Posted by TrifonovS View Post
When I compile my existing projects with the new NSIS version 3.0a1, it prints only several lines in the output window of the editor. With the older version 2.46 this is different.
This change is listed in the release notes. It should also compile a little faster without all the prints.

Use makensis -v4 foo.nsi to print everything...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st November 2013, 07:06   #63
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
I think that there is a problem with some existing plug-ins when the unicode support is enabled (Unicode true). For example Aero plug-in can not show correct some German letters. The problem is not in my code, because when I don't enable Aero plug-in the branding text is shown correct. I also had a problem with the caption-text of the inetc plug-in. When I disable unicode support all works fine. But when I enable it, the installer stops with a strange message.
TrifonovS is offline   Reply With Quote
Old 21st November 2013, 08:49   #64
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Quote:
Originally Posted by TrifonovS View Post
I think that there is a problem with some existing plug-ins when the unicode support is enabled (Unicode true). For example Aero plug-in can not show correct some German letters. The problem is not in my code, because when I don't enable Aero plug-in the branding text is shown correct. I also had a problem with the caption-text of the inetc plug-in. When I disable unicode support all works fine. But when I enable it, the installer stops with a strange message.
I thought Afrow UK already said this was a bug in his plugin?

For anything else, post some example code or something, we are not mind readers...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st November 2013, 10:56   #65
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
Quote:
I thought Afrow UK already said this was a bug in his plugin?
This was for showing of the ampersand symbol. I though that this is different problem.

Quote:
For anything else, post some example code or something, we are not mind readers...
Of course, you are right. I was under a big time pressure with my project and I came back to NSIS V2.46. I will try to find time to install again NSIS V3.0a1 and to prepare simple code that can reproduce the problem (at least this one with inetc plug-in). I just though that might be useful to write some notes, because probably somebody already knows about these problems.
TrifonovS is offline   Reply With Quote
Old 21st November 2013, 13:42   #66
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
So here is simple script that shows a strange behavior of the inetc plug-in. It just tries to download SP3 for Windows XP from a predefined location. When Unicode is true, after execution, it doesn't download anything, but just exits and the returned value is shown in a message box. The return value is unreadable. But when Unicode is set to false, the downloading is started. At the end (or if it is interrupted) the returned value is readable as it is expected.
Attached Files
File Type: nsi InetcProblem.nsi (1.1 KB, 140 views)
TrifonovS is offline   Reply With Quote
Old 21st November 2013, 14:16   #67
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Quote:
Originally Posted by TrifonovS View Post
So here is simple script that shows a strange behavior of the inetc plug-in. It just tries to download SP3 for Windows XP from a predefined location. When Unicode is true, after execution, it doesn't download anything, but just exits and the returned value is shown in a message box. The return value is unreadable. But when Unicode is set to false, the downloading is started. At the end (or if it is interrupted) the returned value is readable as it is expected.
...and you are using the Unicode version of the plugin?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st November 2013, 14:41   #68
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
When strings are wrong/corrupted/1 character long you should always make sure that you are using the correct plugin that matches your target.

Quote:
*Unicode true
*!addplugindir to inetc unicode folder
*change $TEMP\ServicePack3 to $TEMP\Download in inetc::get call
and it works...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st November 2013, 17:28   #69
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 190
That's right! I really forgot that I have to use an Unicode version of the plug-in. Thanks a lot and sorry for my mistake.
TrifonovS is offline   Reply With Quote
Old 27th November 2013, 01:00   #70
roytam1
Member
 
Join Date: Aug 2003
Posts: 81
does FileRead and FileReadByte broken if Unicode true?
roytam1 is offline   Reply With Quote
Old 27th November 2013, 08:10   #71
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,106
Quote:
Originally Posted by roytam1 View Post
does FileRead and FileReadByte broken if Unicode true?
Fixed in next alpha:
Quote:
FileRead in Unicode installers can handle DBCS, conversion output is limited to UCS-2.

FileRead in Unicode installers now uses the Unicode replacement character (U+FFFD) for invalid characters and not '?'.

FileReadByte no longer performs a Unicode conversion on non-ASCII characters

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