Skip to content
⌘ NSIS Forum Archive

/D switch and application Name

3 posts

fluidz91#

/D switch and application Name

Hi,

i used to set /DOutFile="[path]/setup.exe" at compilation time to set path of application.
I wanted to add another /D switch like :


makensis /V2 /DOutFile="..\Dist\pdc\setup.exe" /DInstallProdName="MyNewApp" setup.nsi
and in the setup.nsi :


!ifndef InstallProdName
!define InstallProdName
!endif
..."MyOldApp"
Name ${InstallProdName}
....
VIAddVersionKey /LANG=${LANG_FRENCH} ProductName ${InstallProdName}
...
!ifndef OutFile
!define OutFile "setup.exe"
!endif
But it doesn't work (but Outfile variable works), it always take "MyOldApp" as if InstallProdName was never defined.
is it possible to define these variables at compile time ?
{_trueparuex^}#
Quote ${InstallProdName}

Name "${InstallProdName}"
...
VIAddVersionKey /LANG=${LANG_FRENCH} ProductName "${InstallProdName}"
fluidz91#
Re: /D switch and application Name

Well, i wanted to delete that post beacause my code worked but my build procedure was bugged. By the way you gave me a important clue because i forgot to use quotes for my variable !


Originally posted by fluidz91
Hi,

i used to set /DOutFile="[path]/setup.exe" at compilation time to set path of application.
I wanted to add another /D switch like :


makensis /V2 /DOutFile="..\Dist\pdc\setup.exe" /DInstallProdName="MyNewApp" setup.nsi
and in the setup.nsi :


!ifndef InstallProdName
!define InstallProdName
!endif
..."MyOldApp"
Name ${InstallProdName}
....
VIAddVersionKey /LANG=${LANG_FRENCH} ProductName ${InstallProdName}
...
!ifndef OutFile
!define OutFile "setup.exe"
!endif
But it doesn't work (but Outfile variable works), it always take "MyOldApp" as if InstallProdName was never defined.
is it possible to define these variables at compile time ?