Old 13th March 2019, 11:51   #1
Endy-kun
Junior Member
 
Join Date: May 2015
Posts: 24
%1 in !finalize replaced only once

As title says, it seems in a single !finalize command I can't use %1 multiple times. First one gets replaced properly, but after that it remains as plaintext.

Example
!finalize 'ECHO %1 %1 > echo.txt"'

Not looking for a workaround, just this seems like something that needs to be addressed in the future.
Endy-kun is offline   Reply With Quote
Old 13th March 2019, 14:08   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,028
The docs don't really claim you can use it multiple times.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th March 2019, 14:10   #3
Endy-kun
Junior Member
 
Join Date: May 2015
Posts: 24
They don't. They also don't say that it can only be used once, which is counter-intuitive.
Endy-kun is offline   Reply With Quote
Old 13th March 2019, 14:39   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,028
You can call !finalize more than once if you need to pass it to multiple tools.

I'll add support for using %1 multiple times if you can come up with a real-world scenario where it is needed.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th March 2019, 14:53   #5
Endy-kun
Junior Member
 
Join Date: May 2015
Posts: 24
I was using a console tool that takes file input and produces file output. I attempted to derive output filename from %1, but since I had to pass it 2nd time for that it turned out to be a no-go. Of course there are plenty of ways around that, i just thought "ugh, that really should have worked!"
Endy-kun is offline   Reply With Quote
Old 13th March 2019, 18:56   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,028
Seems reasonable enough, fixed.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump