Old 1st February 2010, 08:51   #1
Veit
Junior Member
 
Join Date: Feb 2010
Posts: 2
StrRep outside of sections

I'm having trouble of using StrRep from StrFunc.nsh. What I wanted to do is converting a Version string from 1.2.3 to 1_2_3 to use in the OutFile Attribute, but it just won't work. Is there a way to use StrRep outside a section?
My code looks like this:

code:

!define PRODUCT_VERSION "1.2.3"
!include "StrFunc.nsh"
${StrRep}

${StrRep} $0 "${PRODUCT_VERSION}" "." "_"
OutFile "${InstallerPath}\Setup\Application_$0_setup.exe"




TiA
Veit is offline   Reply With Quote
Old 1st February 2010, 09:23   #2
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
Hi Veit,

Check this article http://nsis.sourceforge.net/Invoking_NSIS_run-time_commands_on_compile-time.
You should be able to perform what you desire.

Isawen

isawen is offline   Reply With Quote
Old 1st February 2010, 09:48   #3
Veit
Junior Member
 
Join Date: Feb 2010
Posts: 2
isawen:
Thanks for the reply. I was hoping for an easier solution.
I think I will the just define two Product Versions, one with dots and one with underscores.

Veit
Veit is offline   Reply With Quote
Old 1st February 2010, 10:01   #4
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
You cannot use StrRep outside sections.
The easly way it will be for you to have two declarations of the version.

isawen 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