Skip to content
⌘ NSIS Forum Archive

Console Installer

6 posts

bencurthoys#

Console Installer

This is going to sound like a mad thing to want, but: I'm after a scriptable installer that isn't huge and doesn't suck, which DOESN'T have a UI.

I've got a SaaS system and I need to move builds of a web application up from development environments to test and production environments. And so what I did was what I've always done: write NSIS installer scripts for them. Even though they were never going to be installed by a 3rd party outside the organisation, that just seemed like the way to do it.

As time goes by I'm automating more and more of the build and deployment process, and whilst I guess I could accomplish what I want with a zip file and some powershell, the natural thing to do is to want to stick with NSIS.

Right now I run my NSIS exes with /S and /D to silently install the files where my other scripts say they should go, but it would be great it if were easier to control which components are selected from the command line (at the moment I just make an setup exe per component), and to capture the output to STDOUT so I can feed it back into my logging.

My Googlefu fails me: I can't find a tool which is designed to do this, and I can't find anyone else talking about how they accomplish this task. Is there some way of making NSIS do it?
Anders#
You can use ${GetParameters}+${GetOptions} from FileFunc.nsh to parse custom command line parameters so you can choose sections.

Writing to the console is not perfect but something like http://forums.winamp.com/showpost.ph...79&postcount=4 is as close as you are going to get without compiling a custom NSIS version.
Nutzzz#
Anders seems to dismiss recompiling NSIS, but FYI it's super easy to do with the scons flag NSIS_CONFIG_LOG_STDOUT=yes
Nutzzz#
As a followup, if you're going to compile a stdout version, you might also want to comment out lines 1607 and 1609 from exehead\exec.c so "LogSet on|off" calls aren't reported.
bencurthoys#
Thanks! It looks like building a new version is the way to do it, though that's going to have to wait until I'm in the frame of mind to install Python and scons and lose a day to a learning curve =)