1
votes

I have this WinForms project (based on this one, but modified for SharePoint 2010) that is actually a setup wizard for installing SharePoint 2010 solution packages (.wsp).

This project besides installing the .wsp, runs some .sql scripts on a SQL Server database.

My question is how can I create an MSI/EXE installer with all the resources (.wsp file, .sql files, images) embedded inside so I only have one file to distribute?

Please take in mind that using a Visual Studio Setup Project is not an option because that generates an installer to install the installer. I don't need that, the WinForms project IS the installer.

Hope I'm clear enough.

Thanks.

UPDATE

Just to be clear, the WInFroms project IS the installer. It contains the wizard dialogs and runs the code to install the Sharepoint solution, runs the SQL scripts, etc.

When I compile the project I end up having a bunch of files with the following structure:

\en-us
\Resources
SomeThirdParty.dll
AnotherThirdParty.dll
Setup.application
Setup.exe
Setup.exe.config
Setup.exe.manifest
Setup.pdb
Setup.vshost.application
Setup.vshost.exe
Setup.vshost.exe.config
Setup.vshost.exe.manifest

What I need is a tool to package everything in a MSI installer that will auto-extract and auto-execute setup.exe. NOT a tool to generate the installer itself, the installer is already coded, it's the WinForms project itself.

3

3 Answers

1
votes

Advanced Installer offers support for this, although the features you need are available only in the licensed versions. Basically, you can either create an MSI wrapper which simply launches your project and executes the SQL scripts or try to use its dedicated SharePoint support.

Another approach would be something like IExpress. A self-extracting EXE which launches the files contained inside it.

0
votes

I have used Wix with success in the past. http://wix.sourceforge.net/

You can embed resources in the msi so you will only have one file to distribute. Additionally any custom installation steps you need to perform can be accomplished by writing custom actions in c# or vb.net code.

0
votes

Like Cosmin Pirvu mentioned, you are asking for a self-extracting installer. One I have used in the past is a free version from Chilkat Software called ZIP 2 Secure EXE.

If all your assemblies are .NET, then you can also try ILMerge to just them all into a single assembly. Although that wouldn't help with the .manifest and .config files.

EDIT: An alternative to using ILMerge is embedding the dlls into your executable, as described here.