timecop12
11th October 2003 19:37 UTC
transform a date
Hi,
I need some help with a transforming problem:
My installer should read the file date from an exe-file on the end of the Installation (.onInstSuccess).
The date must be in this form: YYYYMMDD
How to transform the date?
After this the Installer have to write this
transformed date to a registry-value (WriteRegStr).
Thanks for help.
-timecop
(I'm using NSIS2 current CVS)
Joost Verburg
11th October 2003 20:29 UTC
Use StrCpy, see documentation for details.
timecop12
11th October 2003 20:37 UTC
I will try, thanks.
timecop12
11th October 2003 21:19 UTC
OK, I read the documentation and a lot of stuff in the forum.
But I don't know, how to make a date like 20031010 form the DWORD-Values by GetFileTime.
Any ideas? I'm thankful for every solution.
-timecop
kichik
12th October 2003 11:56 UTC
This should do it:
GetFileTime F:\Temp\bla.nsi $1 $0
System::Int64Op $1 * 0x100000000
Pop $1
System::Int64Op $1 + $0
Pop $0
System::Call "*(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2) i .r1"
System::Call "Kernel32::FileTimeToSystemTime(*l r0, i r1)"
System::Call "Kernel32::GetDateFormatA(i 0, i 0, i r1, t 'yyyyMMdd', t .r0, i ${NSIS_MAX_STRLEN})"
timecop12
12th October 2003 16:52 UTC
Hi kichik,
works fine. I'm happy.
Thank you. You're the best.
-timecop