I developed an installer using NSIS. Every time I re-install the application, I want to create a backup of the existing database files.
How can I rename these database files using the following format 'currentdatetime'(ex: 201003101140 means 2010-03-10 at 11:40 AM)?
Thanks !
There is a built-in function in NSIS for this called ${GetTime}
!include "FileFunc.nsh"
!insertmacro GetTime
${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
DetailPrint "currentdatetime=$2$1$0$4$5$6"
This will output something like
currentdatetime=20130210205537
meaning "10-Feb-2013 20:55:37".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With