Unicode fixes
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6216 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
615ce82030
commit
382b2fa282
11 changed files with 150 additions and 49 deletions
|
@ -103,13 +103,9 @@ int _tmain(int argc, TCHAR* argv[])
|
|||
|
||||
// Validate filename
|
||||
|
||||
tifstream fs(filename.c_str());
|
||||
|
||||
if (fs.is_open())
|
||||
{
|
||||
filefound = 1;
|
||||
fs.close();
|
||||
}
|
||||
FILE*fIn = FOPEN(filename.c_str(), _T("rb"));
|
||||
filefound = !!fIn;
|
||||
fclose(fIn);
|
||||
|
||||
// Work
|
||||
|
||||
|
@ -143,29 +139,25 @@ int _tmain(int argc, TCHAR* argv[])
|
|||
|
||||
// Write the version to an NSIS header file
|
||||
|
||||
tofstream header(argv[3], tofstream::out);
|
||||
|
||||
if (header)
|
||||
FILE*fHdr = FOPEN(argv[3], _T("wt"));
|
||||
if (!fHdr) return 1;
|
||||
|
||||
// File content is always ASCII so we don't use TCHAR
|
||||
if (!filefound)
|
||||
{
|
||||
|
||||
if (!filefound)
|
||||
{
|
||||
header << _T("!define LIBRARY_VERSION_FILENOTFOUND") << endl;
|
||||
}
|
||||
else if (!versionfound)
|
||||
{
|
||||
header << _T("!define LIBRARY_VERSION_NONE") << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
header << _T("!define LIBRARY_VERSION_HIGH ") << high << endl;
|
||||
header << _T("!define LIBRARY_VERSION_LOW ") << low << endl;
|
||||
}
|
||||
|
||||
header.close();
|
||||
|
||||
fputs("!define LIBRARY_VERSION_FILENOTFOUND\n", fHdr);
|
||||
}
|
||||
else if (!versionfound)
|
||||
{
|
||||
fputs("!define LIBRARY_VERSION_NONE\n", fHdr);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(fHdr, "!define LIBRARY_VERSION_HIGH %u\n", high);
|
||||
fprintf(fHdr, "!define LIBRARY_VERSION_LOW %u\n", low);
|
||||
}
|
||||
|
||||
fclose(fHdr);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue