Archive: Visual Studio integration


Visual Studio integration
Hello!

I would like to be able to create a VS project that has as its target a NSIS installer. Has anyone here been able to persuade VS to do this?

Regards,
Mattias


I don't understand your question. Do you want to build NSIS installer via MSVS?


Yes, that's correct. I want to be able to create a sub project in my solution that will produce the NSIS installer (from my NSIS script). Typically I would have two projects in my solution; one that builds my application and one that builds the installer. When building the whole solution both projects would be built and the end result would be a NSIS installer.

Am I making any sense? :-)

:.:: mattias


You can use the command line to create the installer (run makensis.exe). The command can be done as a post compile step in visual studio.

Don


Originally posted by brasse When building the whole solution both projects would be built and the end result would be a NSIS installer.
I've thought of doing something similar. For me, I'm leaning towards making it all command line based.

We need to a) Build projects b) obfuscate the files c) make an installer d) make an auto updater (using NSIS), e) deploy the files and f) change our server's auto update logic to reflect that a new update is available to beta testers.

I just can't see me pulling all that off from within Visual Studio. But if there's a way I could tell Visual Studio to run a script which runs steps b through f, I'd be very happy to find out how :)

b) Do you mean "get" files? If you do then you could write batch to copy them
c) and maybe d) makensis
e), f) On your choice

"The way how to tell Visual studio" is the Post-build (on successfull build) in your project's settings.


Originally posted by pospec
[...]
"The way how to tell Visual studio" is the Post-build (on successfull build) in your project's settings.
The way I presonally prefer to do it is as a separate VS project itself. Specifically, a 'makefile' project with the project's "Build Command Line" property is set to: 'makensis.cmd "arg1" "arg2" ...etc'.

That way I can Build (or Rebuild) just that one "Setup" project (via right-clicking on it in the Solution Explorer pane and selecting "Project Only"->"Rebuild only xxx") without having to rebuild the prerequisite project that creates all the product binaries (which can conceivably, depending on the size of your "product", take quite a long time!).

That is to say, there's no need to Rebuild your product binaries in order to rebuild/test your product's INSTALLER project! ;)

Just a thought. <shrug>

Yes, you're right, you can do it that way.


Originally posted by brasse
Yes, that's correct. I want to be able to create a sub project in my solution that will produce the NSIS installer (from my NSIS script)...
Maybe NSIS will be also available as a Visual Studio integration in the future. But for now I know 3 integrated solutions for Visual Studio only:
Hope that helps!

for the URLs

Originally posted by Kraiggy
Maybe NSIS will be also available as a Visual Studio integration in the future. But for now I know 3 integrated solutions for Visual Studio only:
  • Setup and Deployment Projects (MSI based) website
  • WiX - integrates WiX toolset (MSI based) website
  • Lexpa - integrates Inno Setup (non-MSI based) website

Hope that helps!

A Thoughtful Idea
Althought it's not a Visual Studio add-in, the iNSISt Framework (http://www.codeplex.com/insist) looks promising, and a Visual Studio add-in could easily be built on top of it.

For example, since the framework uses XML files to auto-generate NSIS scripts, a Visual Studio add-in would simply have to edit/regenerate an XML file each time a project's structure changes (files are added, removed, etc.). Then, as was mentioned in previous posts, there are several ways to use Visual Studio to invoke the NSIS compiler on the generated script to "build" it. This would essentially automate the process of maintaining NSIS scripts for VS projects.