Pomflain
12th February 2002 06:53 UTC
Possible new feature?
One of the issues I'd been dealing with lately was versioning of the installer executables. Specifically I'd make up a new version and then put it up for local testing, then go add some new changes, tweak a few things, etc. and then end up with someone having an issue and it could be one of ten different versions I made up during the day. So I figured I'd add in a time/date stamp to the installer so then I'd know exactly when the version was made. Someone then pointed out to me that some people might like different versions how the time & date are represented locally, so what I came up with is a bunch of symbols. $MONTH, $DAY, $YEAR, $HOUR, $MINUTE, and $SECOND. So then you could represent things however you want. I then use DetailPrint to write it to the details window.
DetailPrint "Compiled: $MONTH $DAY $YEAR at $HOUR:$MINUTE:$SECOND"
Does this interest anyone else as a useful feature? I'm sure you can think of many ways to use something along those lines, I was just looking for some way to keep track of versions without too much hassle.
Pomflain
12th February 2002 07:24 UTC
Ooopppsss
When I moved things from being a compiler command to the $SYMBOL style, now it's putting in the date at runtime instead of at compile time, just noticed that. Oh well, back to the drawing board for me...
bballer182
13th February 2002 07:12 UTC
sounded kind of nice to me
Pomflain
13th February 2002 07:40 UTC
Thanks.
Well I've added it back in as a separate command, but I liked the added flexibility of using it with the current commands. I suppose I could always add it in with a dll, but I don't really think it's worth the extra overhead, and I don't know if that would work right anyway. So I'm just going to leave it as a new command for right now since I need to have that feature in the installers.
rainwater
13th February 2002 15:47 UTC
It may be simpler to just pass a define on the command line. Something like:
makensis /DLOCALVER=1.11.1 script.nsi
Then you could just say:
!ifdef LOCALVER
!define VERSION ${LOCALVER}
!else
!define VERSION 1.1
!endif
Then you just change the define for each of your builds. You could automate the process to do this automatically.
Another solution would be to use an extension dll like the date dll that I wrote. Then create an installer that gets the current date, then executes makensis on the script file using the formatted date as a define as I described above. So you could use an installer to create an installer. If you want the date extension let me know. It lets you create a date format string and call the dll, then it returns the current date in the format you set.
bballer182
14th February 2002 00:18 UTC
sounds even better!:up:
Pomflain
14th February 2002 20:19 UTC
Originally posted by rainwater
Another solution would be to use an extension dll like the date dll that I wrote. Then create an installer that gets the current date, then executes makensis on the script file using the formatted date as a define as I described above. So you could use an installer to create an installer. If you want the date extension let me know. It lets you create a date format string and call the dll, then it returns the current date in the format you set.
Sure, send away.
Thanks.
SmartyMan
15th February 2002 01:43 UTC
Re: Possible new feature?
Originally posted by Pomflain
so what I came up with is a bunch of symbols. $MONTH, $DAY, $YEAR, $HOUR, $MINUTE, and $SECOND. So then you could represent things however you want. I then use DetailPrint to write it to the details window.
DetailPrint "Compiled: $MONTH $DAY $YEAR at $HOUR:$MINUTE:$SECOND"
Does this interest anyone else as a useful feature?
I've just implemented that in NSISplus, it will be available in the next update; see attachment to get an idea on how it will work (the "${.DATE}" will create alle the defines you wanted using the /D compiler option)
rainwater
15th February 2002 03:59 UTC
Here's the dll extension that will create any date format string you want. See this thread.