Dj Nyx
17th August 2004 15:21 UTC
Set PRODUCT_NAME onInit
Hi,
I'd like to have a modular productname, productversion etc. in my installation.
Is there any way to read them out of a file?
I've tried to set them "onInit" but i wasn't able to make it work.
Is there any way to make this?
greetz with beatz
nyx
Comm@nder21
17th August 2004 15:40 UTC
use !defines.
i use something like that on top of my code (before everything else):
!define Product_Name "skfhaskdfh"
!define Product_Version "1.2.3.4"
!define Product_Publisher "sdkfhskdjhfe"
then later like that:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Product_Name}" "DisplayName" "${Product_Name}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Product_Name}" "DisplayVersion" "${Product_Version}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Product_Name}" "Publisher" "${Product_Publisher}"
same for anything related inside my code.
so i just edit the lines on top to change the name for the whole script.
Dj Nyx
17th August 2004 15:57 UTC
yeah, i already use defines...
i tried it with the registry entrys but i have still the same problem...
he takes the value of $PRODUCT_NAME from the define...
zimsms
17th August 2004 18:01 UTC
You can do this, exactly as you said. However, you need a second nsis script that when compiled reads the values from an ini file then calls the second script passing in the values. ie: Product name, your favourite color etc.
Easy As 124? hehe.