Skip to content
⌘ NSIS Forum Archive

Using variable as part of a string?

3 posts

Dsstrainer#edited

Using variable as part of a string?

I've been yanking my hair out for over an hour with this stupid thing...

I am trying to do this.

I want to add the date to my output file name like: myfile_20080430.exe

The ${__DATE__} function gives: 04\30\2008

I figured using the CharStrip function from the wiki would be useful so I could strip the "\" slashes from the date.

But how do I use the variable in my file name?

I have:

Section "strip" Section0

${CharStrip} "\" ${__DATE__} $R0
DetailPrint ${R0}

SectionEnd

OutFile "\\fshare08\iscommon\is_development\QA\QA Tools\OSF_Test.exe_${R0}"

But it is displaying the actual text: "R0" not the value stored there. I've tried $R0, "$R0", '$R0',"${R0}", etc.. nothing works.

The NSIS documentation says I can use DetailPrint to display the contents of a variable. But it also shows the literal text, R0 not the contents.
{_trueparuex^}#
Man you are mixing up compile time and runtime things totogether. You can't name the installer at compile time with a function that runs in the installer at the runtime. 😁

You should define date with your own format and use it instead of messing around with ${__DATE__}...

See topic:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.