Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run external setup program in my Visual Studio setup project

I'm using a Visual Studio Setup Project to create a setup program for my new Windows program (single EXE file). The only thing it seems to be missing is a way to run a component installer. I need to bundle and run a separate installer EXE with my program, but whenever I try to run it as a custom action, I get the "nested installer" error (You cannot run a setup within a setup).

So, short of buying a commercial installation program ($$$$), is there a way to write a custom action to do this? I've seen a few tutorials on this, and it doesn't look that intimidating, but I'm worried about getting the custom action to run after (or before) that setup transaction lock is freed so the next installer can run.

Suggestions?

Thanks!

like image 824
MarcWan Avatar asked Sep 21 '12 08:09

MarcWan


People also ask

How do I add a setup file in Visual Studio?

Go to Extensions > Manage Extensions > Online > Search, find, download and install Microsoft Visual Studio Installer Projects extension. 2). Add a new Setup Project in your solution > right-click Application Folder > Add > Project Output… > choose the corresponding Project > select Primary output > OK.

How do I run Visual Studio setup?

In the Windows Start menu, you can search for "installer", and then select Visual Studio Installer from the results. If you have Visual Studio open, select Tools > Get Tools and Features..., which opens the Visual Studio Installer.

How do I add a custom action to Visual Studio setup project?

On the Action menu, click Add Custom Action. In the Select Item in Project dialog box, double-click the Application Folder. Select the gadget assembly that was added to the setup project, and then click OK. In the Properties window, make sure that the InstallerClass property is set to True (this is the default).


1 Answers

Basically what you want, in MSI terms, is a Custom Bootstraper. Setup and Deployment projects have limited support for this. Adding Custom Prerequisites (latest version) details how to add pre-requisites to the built-in bootstrapper.

Unfortunately Setup and Deployment projects are not supported in Visual Studio 2012; so, spending much time on something like this may not add much long term value.

WiX is another MSI installer framework that is recommended by folks at Microsoft (the authors work at Microsoft). It has a feature that it calls Bundling that allows chaining of MSIs (via its bootstrapper). It's really easy to create a WiX project from and existing MSI using a utility called Dark (http://weblogs.asp.net/lorenh/archive/2004/05/09/128899.aspx is a good intro to using Dark). Once you get that can edit the wxs file to add a bundle.

Other Wix resources: http://wix.tramontana.co.hu/tutorial

like image 127
Peter Ritchie Avatar answered Oct 01 '22 05:10

Peter Ritchie