1

If I would like to dynamically create an MSI installer, is there a way to do this without including the wix sdk applications such as candle.exe and light.exe? If my application is written in C#, could I reference the Microsoft.Deployment.WindowsInstaller.Package.dll, or some other wix dlls, and create a new MSI file for instance?

I basically want to dynamically create an msi file, using a console application, without having to reference the wix console applications.

1
  • 2
    You can download the sourcecode of wix, so you can do anything wix can yourself using the same sourcecode. Commented May 21, 2012 at 6:47

2 Answers 2

1

If my application is written in C#, could I reference the Microsoft.Deployment.WindowsInstaller.Package.dll, or some other wix dlls, and create a new MSI file for instance?

Yes. Those Microsoft.Deployment.* DLLs are referred to as the "Deployment Tools Foundation", and they are documented in dtf.chm and dtfapi.chm files in the doc folder of your wix installation.

Creating a new MSI from scratch would start like this:

string path = "path/to/myinstaller.msi";
using (var db = new Database(path, DatabaseOpenMode.Create))
{
    // lots of SQL queries to put stuff in the database here
}

Alternatively, you could copy an existing template MSI file, and then use SQL queries to modify it.

You would also need to package binary files and add them to the database. You can do that by opening the msi with the InstallPackage class.

In any case, creating an installer in this way will require detailed knowledge of the Windows Installer Database Tables.

Sign up to request clarification or add additional context in comments.

Comments

0

You can do it: you can use WiX API (subject to licensing terms imposed by WiX) as well as Windows Installer API directly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.