184

My Wix project creates install.msi and cab1.cab. How can I have it bundle everything into the msi? I will likely use 7-zip SFX to work around this but I have seen other apps with only a single msi.

4 Answers 4

282

You didn't post any source but I assume your wxs file has a Media element. Just set the EmbedCab attribute to "yes" in MediaTemplate e.g.

<MediaTemplate EmbedCab="yes" /> 
Sign up to request clarification or add additional context in comments.

3 Comments

I had an empty MediaTemplate element but I replaced it with this: <Media Id="1" Cabinet="Cab1.cab" EmbedCab="yes" /> Thanks!
Note, you can add EmbedCab="yes" to the MediaTemplate element to achieve this.
MediaTemplate wasn't available until WiX 3.6. wtjones didn't mention what version of WiX he was using so I mentioned the way that would work for more people.
77

Set EmbedCab="yes".

Since WIX 3.8:

<MediaTemplate EmbedCab="yes" /> 

Before WIX 3.8:

<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" /> 

Comments

26

Use it like this :

<Media Id="1" Cabinet="CabFileName.cab" EmbedCab="yes" /> 

Also this article describes other ways of doing it.

1 Comment

Your link is broken
11

With WiX toolset v4 you just need to add the following MediaTemplate element inside your Package element:

<MediaTemplate EmbedCab="yes" /> 

1 Comment

I'm doing exactly that, and I'm using Wix v4, but it's still not packaging the cab file into the msi. I can't see why the default behavior would be to leave it hanging outside the installer file. But I guess I can live with it that way if I have to.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.