|
|
#1 |
|
Junior Member
Join Date: May 2012
Posts: 2
|
Dinamic PRODUCT_NAME
hi,good evening.
I'm new on nsis language,and i'm trying to create a "special" installer. In that installer,i need to change the name of the app depending the commandline used to execute the installer. An example must be installer.exe /name = musicplayer. the problem it's that the productname it's declared outside any function/section,only declared by: !define PRODUCT_NAME "example" OnInit function i have the value of the argument passed,but i can't give it to the PRODUCT_NAME variable becouse it's a constant.So i tryed to declare OnInit: Function .onInit done: Var /GLOBAL caption !include FileFunc.nsh ${GetOptions} $CMDLINE "/p" ${caption} FunctionEnd but it can't be seen in other function/section like ${caption},neither out of function/section. the case it's that i want to know if it's possible to on onInit set a global variable with the name passed as argument and acces it in any function/section/out and the syntaxis to access it.(for example in PRODUCT_NAME) PD: thanks everybody Last edited by athalow; 4th May 2012 at 17:02. Reason: help |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Your syntax/code is wrong.
You don't use curly parenthesis for variables.code: Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2012
Posts: 2
|
thanks for the response.
Yes it seems that {} are only for the constants |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,841
|
Actually ${} are for defines, not constants. Constants are things like $PROGRAMFILES. http://nsis.sourceforge.net/Docs/Chapter4.html#4.2.3
|
|
|
|
![]() |
|
|||||||
| Tags |
| arguments, global, product_name, variable, visibility |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|