Compile Time Commands
How could i do this(@ Compile time)?
!define SetupMode "1"
...
!if ${SetupMode}=="1"
!insertmacro DoSomething
!else
!insertmacro DoTheOtherThing
!endif
Archive: Compile Time Commands
Compile Time Commands
How could i do this(@ Compile time)?
!define SetupMode "1"
...
!if ${SetupMode}=="1"
!insertmacro DoSomething
!else
!insertmacro DoTheOtherThing
!endif
If you can get to http://nsis.sf.net/ then you can find the answer in the FAQ on that page. If it's lagging for you too see StrCmp, StrCpy and IntCmp in the manual. Some examples in the Examples directory use those, so you can look at them for usage example.
Isnt StrCmp, StrCpy and IntCmp RunTime only?
What I want is to !include a file only if a define is defined to a certain(sp?) value...
Oh sorry, didn't read that right... I have no ideas for that at the moment, but something with !system would probably do the trick.
Here's a trick I've used:
!define SetupMode "1"
...
!define SetupModeIs${SetupMode}
!ifdef SetupModeIs1
!insertmacro DoSomething
!else
!insertmacro DoTheOtherThing
!endif
!undef SetupModeIs${SetupMode}
From Help File:
!system: This command will execute 'command' using a call to system()i dont know what 'system()' is and the only example i could find was in makensis.nsi:
!system '"${NSISDIR}\Bin\InstallCVSData.exe" nooverwrite'dont know what those lines do but it looks to me like they call an external program...
!echo "Compiling CVS Data Setup..."
!system '"${NSISDIR}\makensis.exe" /V1 cvsdata.nsi' = 0
#if _MSC_VER > 1000 <--This is what I needI'm guessing that this is currently not possible, but could support be added 4 this in the future??
#pragma once
#endif // _MSC_VER > 1000
It's currently not possible, but if you give more details we might be able to help you with other solutions.
i guess i have to hack nsis myself then, script.cpp would be the right place to do it right?
Yes, but why not use eccle's method?
because i want to use stuff like !if ${somedefine} > 4...
OK, good luck. Submit a patch if you get it working. If you don't you can use !system to call anotehr program that will do this, like perl for example. You can get the program to write a NSH file which you would !include and use.
what im trying do is create a script file that makes it real easy to create a setup...
this is all i need to create the setup for one of my apps:
!define APP_NAME "YourApp"
!define APP_COMPANY "Nullsoft Fan =)"
!define APPFILE_MAIN_SRCTREEPATH "..\Source\ReleaseU\${APPFILE_MAIN_BINNAME}"
!include "nsw.nsh"
A worthy goal indeed :)
Joost or kichik,
Has this feature ever been added to nsis? It was posted over a year ago and I am trying to do the same thing.
http://forums.winamp.com/showthread....61#post1477361
Its seems straight forward to add just a binary compare equals to the compile time !ifdef APP_COMP == "sdfsd" to nsis. Can this be done?
Was it done?
Thanks,
art