Fixed VIAddVersionKey failing on empty inputs
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2881 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9ad4dd958b
commit
148c9a1b86
2 changed files with 7 additions and 7 deletions
|
@ -73,9 +73,9 @@ void CResourceVersionInfo::SetProductVersion(int HighPart, int LowPart)
|
||||||
// Util function - must be freeded
|
// Util function - must be freeded
|
||||||
WCHAR* StrToWstrAlloc(const char* istr, int codepage)
|
WCHAR* StrToWstrAlloc(const char* istr, int codepage)
|
||||||
{
|
{
|
||||||
int strSize = strlen(istr);
|
int strSize = MultiByteToWideChar(codepage, 0, istr, -1, 0, 0);
|
||||||
WCHAR* wstr = new WCHAR[(strSize*2)+1];
|
WCHAR* wstr = new WCHAR[strSize];
|
||||||
MultiByteToWideChar(codepage, 0, istr, -1, wstr, strSize*2);
|
MultiByteToWideChar(codepage, 0, istr, -1, wstr, strSize);
|
||||||
return wstr;
|
return wstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -380,13 +380,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
if (overwriteflag >= 3) // check date and time
|
if (overwriteflag >= 3) // check date and time
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA *ffd=file_exists(buf0);
|
WIN32_FIND_DATA *ffd=file_exists(buf0);
|
||||||
|
// if it doesn't exist, overwrite flag will be off (though it doesn't really matter)
|
||||||
|
int cmp=0;
|
||||||
if (ffd)
|
if (ffd)
|
||||||
{
|
{
|
||||||
// if first one is newer, then don't overwrite
|
cmp=CompareFileTime(&ffd->ftLastWriteTime, (FILETIME*)(entry_->offsets + 3));
|
||||||
int cmp=CompareFileTime(&ffd->ftLastWriteTime, (FILETIME*)(entry_->offsets + 3));
|
|
||||||
overwriteflag=!(cmp & (0x80000000 | (overwriteflag - 3)));
|
|
||||||
}
|
}
|
||||||
// if it doesn't exist, overwrite flag won't matter. it stays on off though.
|
overwriteflag=!(cmp & (0x80000000 | (overwriteflag - 3)));
|
||||||
}
|
}
|
||||||
if (!overwriteflag)
|
if (!overwriteflag)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue