Archive: Automate Creation of .nsi files


Automate Creation of .nsi files
I'm automating builds of our applications (.NET stuff) and looking for a tool to deploy. I've got the build automated using NAnt and staged in D:\Deploy\Application. What I need to do from there is create a .nsi file based on what's in there (D:\Deploy\Application\* recursively). I've found it very easy to create a .nsi and .exe for deployment using NSIWorkbench, but not how to create a .nsi file inside of my build file via command line. Can anyone give me a few pointers or a link to kickstart me?

Much Thanks,
Eric


Since a script is a simple text file you can use a lot of programs to create it. A batch file, VB script or even a NSIS installer could do it. You can use FindFirst, FindNext and FindClose to find all the files in that directory and insert the appropriate File commands in a pre-made template. Put that in a silent "installer" and have NAnt execute it.


Think I figured it out
Please correct me if I'm wrong. I just have to use the /r option on file. For example, if I want D:\Deploy\Application to install at $INSTDIR\ProdAppName, I would:

SetOutPath $INSTDIR
SetCompress Auto
SetOverwrite IfNewer
file /r "D:\Deploy\Application\*.*"

Sorry for the newbie post!


Yes, that's true. So what do you want to automate if not that?


Thanks for the help Kichik!

Sounds like I don't need to automate creation of this file. In NAnt, I stage the dll's, exe's... to a specific directory for deployment. With the /r option, I can just grab all of the files there to put in an installer. So I can just use the same .nsi indefinitely. I can tell NAnt to compile it with the command line, and then stage it on the server where it will be installed.

Is there any way to automatedly run the install remotely? Something like:

run myInstall.exe \\Server


To run the installer on another computer you need something on that computer to run it. NSIS doesn't create a server on other machines that will run the insatller, for that you need another software. I'm afraid I don't know enough about this subject at the moment so you'll have to check MSDN, they will probably have something to say about SMS (Microsoft's software pushing application if I recall correctly).


Thank you very much Kichik! I've got it creating and staging the installs except monkeying with the services and such in one of them. I'm planning to use Sunjammer's plugin for this (x18servicesv0.1.zip). Do I just build this guy and throw the .dll into the plugins directory in order to use its' functionality?


Yes, just put it in the plugins directory. But you don't need to compile it, there is a compiled veresion in the zip iirc.