StrToWstrAlloc -> winchar_fromansi
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4889 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
01ebc199ef
commit
4fb4a1f688
1 changed files with 2 additions and 14 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "winchar.h"
|
||||||
|
|
||||||
#ifdef NSIS_SUPPORT_VERSION_INFO
|
#ifdef NSIS_SUPPORT_VERSION_INFO
|
||||||
|
|
||||||
|
@ -131,19 +132,6 @@ void CResourceVersionInfo::SetProductVersion(int HighPart, int LowPart)
|
||||||
m_FixedInfo.dwProductVersionMS = HighPart;
|
m_FixedInfo.dwProductVersionMS = HighPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Util function - must be freeded
|
|
||||||
WCHAR* StrToWstrAlloc(const char* istr, int codepage)
|
|
||||||
{
|
|
||||||
int strSize = MultiByteToWideChar(codepage, 0, istr, -1, 0, 0);
|
|
||||||
WCHAR* wstr = new WCHAR[strSize];
|
|
||||||
if (!MultiByteToWideChar(codepage, 0, istr, -1, wstr, strSize))
|
|
||||||
{
|
|
||||||
delete [] wstr;
|
|
||||||
wstr = NULL;
|
|
||||||
}
|
|
||||||
return wstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetVersionHeader (LPSTR &p, WORD &wLength, WORD &wValueLength, WORD &wType)
|
int GetVersionHeader (LPSTR &p, WORD &wLength, WORD &wValueLength, WORD &wType)
|
||||||
{
|
{
|
||||||
WCHAR *szKey;
|
WCHAR *szKey;
|
||||||
|
@ -202,7 +190,7 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
|
||||||
WCHAR *KeyName, *KeyValue;
|
WCHAR *KeyName, *KeyValue;
|
||||||
|
|
||||||
strm.resize(0);
|
strm.resize(0);
|
||||||
KeyName = StrToWstrAlloc("VS_VERSION_INFO", CP_ACP);
|
KeyName = winchar_fromansi("VS_VERSION_INFO");
|
||||||
SaveVersionHeader (strm, 0, sizeof (VS_FIXEDFILEINFO), 0, KeyName, &m_FixedInfo);
|
SaveVersionHeader (strm, 0, sizeof (VS_FIXEDFILEINFO), 0, KeyName, &m_FixedInfo);
|
||||||
delete [] KeyName;
|
delete [] KeyName;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue