Old 7th April 2009, 00:15   #1
qwertymodo
Junior Member
 
Join Date: Sep 2008
Posts: 26
Send a message via Yahoo to qwertymodo
compile another script as compile condition

I have an executable generated from an NSIS script that is included in another NSIS script via the File command. Is there any way to use conditional compilation to check for the existence of this executable and if it doesn't exist, compile it from the script, then include it using File? Here's basically what I need, although I know this doesn't work the way it's written, this is just for illustration of the functionality I'm looking for:

code:

!ifndef filename.exe
NSExec ${NSISDIR}\makensis.exe filename.nsi
!endif

Section SomeSection
File filename.exe

. . .

SectionEnd



I'm guessing the answer is "no, just compile the first script by hand you lazy programmer" :P If that's the case I'm fine with that, it would just be nice if it could be worked out this way.
qwertymodo is offline   Reply With Quote
Old 7th April 2009, 00:36   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
something like
code:
!tempfile mytemp
!system 'IF NOT EXIST "otherinstaller.exe" echo !define ItsNotThere > "${mytemp}"'
!include "${mytemp}"
!ifdef ItsNotThere
!echo TODO...
!endif
!delfile "${mytemp}"


IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th April 2009, 17:34   #3
qwertymodo
Junior Member
 
Join Date: Sep 2008
Posts: 26
Send a message via Yahoo to qwertymodo
So you're saying the best that can be done is to send the person compiling a prompt? Ok, I figured it would be something like that.
qwertymodo is offline   Reply With Quote
Old 7th April 2009, 17:55   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
saywhatnow? Its fully automated, you just need to put the compile command there, !system '"${NSISDIR}\makensis" "c:\otherscript.nsi"' = 0 or something like that is all you need

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th April 2009, 21:00   #5
qwertymodo
Junior Member
 
Join Date: Sep 2008
Posts: 26
Send a message via Yahoo to qwertymodo
Oh, my mistake. Forgot about the !system command. Thanks, I'm gonna try it out right now
qwertymodo is offline   Reply With Quote
Old 7th April 2009, 21:15   #6
qwertymodo
Junior Member
 
Join Date: Sep 2008
Posts: 26
Send a message via Yahoo to qwertymodo
I realized that really it would just be easier to always compile the other script fresh, so since the directory structure was permanently set (SVN repo) all I ended up having to do was

code:

!system '"${NSISDIR}\makensis.exe" "..\folderwhereotherscriptis\otherscript.nsi"' = 0



Thanks a ton
qwertymodo 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