Author Topic: NSIS Integration  (Read 3923 times)

Offline rioki

  • Multiple posting newcomer
  • *
  • Posts: 13
NSIS Integration
« on: August 26, 2009, 09:14:39 pm »
Hi,

I have been pondering on how to integrate a installer like NSIS into CB.

The approach to use a "tool" as describes in this thread did not appeal to me since I want to build my workspace and just grab the installer from the output folder. I want my build process to be fully automated to reduce the human error and since it is a waste of human time.

As a result I used a post build step to do it. But the problem is if you put it on your project it the installer is built every time and this can be quite annoying. In addition I have multiple projects that feed into the installer so this approach is a bit flawed.

Finally I use a separate project for the installer. I created a empty project and configured it as console project. I added the nsi file to the project and nothing else. I use the following post build step.

Code
$(#nsis)\makensis $(TARGET_OUTPUT_BASENAME).nsi
xcopy /Y $(TARGET_OUTPUT_BASENAME).exe $(TARGET_OUTPUT_DIR)

Now I can build the workspace have the installer ready. I even can run the installer form CB...

Any comments are welcome on the approach.

I am coming from the GNU Autotools, they are the superior build tools, but CB is just more efficient all in all... The only thing is that I am struggling to get certain things to work as I would like.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: NSIS Integration
« Reply #1 on: August 26, 2009, 09:45:41 pm »
Any comments are welcome on the approach.
Post build steps can be configured to only run if the target has been updated. Check the settings accordingly.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline rioki

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: NSIS Integration
« Reply #2 on: August 26, 2009, 10:16:31 pm »
Any comments are welcome on the approach.
Post build steps can be configured to only run if the target has been updated. Check the settings accordingly.

I know this. I use test driven development and thus I compile about once a minute. Compile time influences directly how fast you develop software. A lengthy rebuild of the installer is in the way. I build the installer max once a day when in testing for a release candidate. In normal situations I build a installer once a week.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: NSIS Integration
« Reply #3 on: August 26, 2009, 10:21:13 pm »
You can also use different build-targets, one with and one without call to nsis in post-build step.

Offline rioki

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: NSIS Integration
« Reply #4 on: August 27, 2009, 09:46:07 am »
You can also use different build-targets, one with and one without call to nsis in post-build step.

I thought about about that solution, after writing the last post. Yes if you have only one project that would do quite well.

My Setup is a bit like this
Code
GameEngine.dll -> GameOne.exe -> GameOneInstaller
                     -> GameTwo.exe -> GameTwoInstaller
                     |
                     -> UnitTestApp.exe  (does not go into installer)     
                     -> SceneEditor.exe       |
                     -> MaterialEditor.exe     | -> GameEngine-SDK-Installer
                     -> PreviewTool.exe       |
                         ResourcePacker.exe  |

I have one workspace with all pieces of the SDK and one workspace for each game that contains the game and game engine. As you can see a simple post build step will not do the trick here.