Modified set_timestamp_define to use FileTimeToLocalFileTime instead of SystemTimeToTzSpecificLocalTime, since the latter is unsupported in Win 9x.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2669 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
7fdfd8a0c5
commit
0b6ed99e50
1 changed files with 6 additions and 5 deletions
|
@ -62,18 +62,19 @@ char *CEXEBuild::set_timestamp_predefine(char *filename)
|
||||||
char datebuf[128] = "";
|
char datebuf[128] = "";
|
||||||
char timebuf[128] = "";
|
char timebuf[128] = "";
|
||||||
WIN32_FIND_DATA fd;
|
WIN32_FIND_DATA fd;
|
||||||
SYSTEMTIME stime, sloctime;
|
FILETIME floctime;
|
||||||
|
SYSTEMTIME stime;
|
||||||
|
|
||||||
HANDLE hSearch = FindFirstFile(filename, &fd);
|
HANDLE hSearch = FindFirstFile(filename, &fd);
|
||||||
if (hSearch != INVALID_HANDLE_VALUE)
|
if (hSearch != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
FindClose(hSearch);
|
FindClose(hSearch);
|
||||||
|
|
||||||
FileTimeToSystemTime(&fd.ftLastWriteTime, &stime);
|
FileTimeToLocalFileTime(&fd.ftLastWriteTime, &floctime);
|
||||||
SystemTimeToTzSpecificLocalTime(0, &stime, &sloctime);
|
FileTimeToSystemTime(&floctime, &stime);
|
||||||
|
|
||||||
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &sloctime, NULL, datebuf, sizeof(datebuf));
|
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &stime, NULL, datebuf, sizeof(datebuf));
|
||||||
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sloctime, NULL, timebuf, sizeof(timebuf));
|
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, sizeof(timebuf));
|
||||||
wsprintf(timestampbuf,"%s %s",datebuf,timebuf);
|
wsprintf(timestampbuf,"%s %s",datebuf,timebuf);
|
||||||
|
|
||||||
definedlist.add("__TIMESTAMP__",timestampbuf);
|
definedlist.add("__TIMESTAMP__",timestampbuf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue