Archive: howTo: outfile myApp_patch_${FORMATED_DATE}


howTo: outfile myApp_patch_${FORMATED_DATE}
  I want to have 'outfile' name something like:

myApp_patch_20040628-0319.exe
that is
myApp_patch_YearMonthDay-HourMin.exe

I can produce YearMonthDay-HourMin.exe string using nsisdt.dll in Section or in Function, but don't know how to use it as suffix to 'outfile' name. Anyone know how to do it?

outfile myApp_patch_${FORMATED_DATE}

Thanks
slamdunk


You have to create another program to get the current date and time and input it in the command line of the original installer. Then, this installer receives the date and time as a !define (means "compile time constant") so you can put where you want.


Thanks.
nsi:

!define PATCH_DATE ${patch_timestamp}

>OutFile "Patch_${PATCH_DATE}.exe"
Python code

import os
import time
try:
os.system(r'g:\app\nsis\makensis.exe /Dpatch_timestamp='+time.strftime("%Y%m%d-%H%M", time.localtime())+' .\patch.nsi')
except:
print("exception: failed")