2

Using very simple code almost same as in examples:

    <?xml version="1.0" encoding="utf-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Bundle Version="1.0" Manufacturer="ACME" UpgradeCode="6AF8AF7D-3B44-4496-9E64-56206DF66C55">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
    <Chain>
    <MsiPackage SourceFile="wpftoolkit.msi"/>
    </Chain>
    </Bundle>
    </Wix>

I get a setup.msi file that produced error imidiatly in start:

    msiexec /i setup.msi /l*v log.txt
    log.txt:
    === Verbose logging started: 02.10.2013  14:12:11  Build type: SHIP UNICODE 5.00.7600.00  Calling process: C:\Windows\system32\msiexec.exe ===
    MSI (c) (B0:48) [14:12:11:804]: Font created.  Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
    MSI (c) (B0:48) [14:12:11:805]: Font created.  Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
    MSI (c) (B0:A4) [14:12:11:823]: Resetting cached policy values
    MSI (c) (B0:A4) [14:12:11:823]: Machine policy value 'Debug' is 0
    MSI (c) (B0:A4) [14:12:11:823]: ******* RunEngine:
    ******* Product: Setup.msi
    ******* Action: 
    ******* CommandLine: **********
    MSI (c) (B0:A4) [14:12:11:824]: Note: 1: 2203 2: Setup.msi 3: -2147286960 
    MSI (c) (B0:A4) [14:12:11:824]: MainEngineThread is returning 1620
    === Verbose logging stopped: 02.10.2013  14:12:11 ===

Tool dark.exe from Wix SDK says that setup.msi is corrupt and cannot be disassembled. Several times last week I managed to compile this type of bundle and msi worked well, but I can't figure out any corellation between what I was doing.

I've also tried to compile this example without using MSBuild, but directly with Wix SDK tools - still no luck - compilation finishes without errors, but resulting msi is corrupt anyway:

    candle *.wxs
    light *.wixobj -out setup.msi -ext WixBalExtension

Is there something I've missed about compiling Wix bundles that prevents it from working right way?

Ujin
  • 95
  • 1
  • 9

2 Answers2

3

A Wix/Bundle is used to produce an executable that chains installers together. Therefore, the output should be given an .exe extension.

You can invoke the WiX Toolset compiler and linker manually as you appear to have done or use an MSBuild project. WiX installs a template project for Visual Studio to use. It's called WiX Bootstrapper. If you didn't know, Visual Studio and SharpDevelop projects are MSBuild projects. So, there are two more ways to build a build: Via the IDE or on the commandline with msbuild.exe.

Note: Visual Studio won't show the four WiX project templates if you install WiX before Visual Studio. In that case, simply Repair the WiX installation.

Tom Blodget
  • 20,260
  • 3
  • 39
  • 72
  • In SharpDevelop I don't have an option to create Wix Budle Project. There are only Empty project and different flavors of WixUI projects. There is also no option in .wixproj file that specifies output file parameters. I believe it depends on a specific wix .target file. – Ujin Oct 04 '13 at 11:20
0

It is absolutely counterintuitive, but I think I've found a solution:

candle *.wxs
light *.wixobj -out setup.EXE -ext WixBalExtension

The output format is EXE, not MSI. Simple, right?

BTW, SharpDevelop (as well as Visual Studio, I believe) doesn't have any option to specify the output file as EXE - only MSI, msp and wixlib.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ujin
  • 95
  • 1
  • 9
  • As a workaround for SharpDevelop IDE i've added a post-build script that replaces Setup.msi with Setup.exe (just renaming doesn't do the trick). Main reason why I don't just switch to some make.bat file is that there are several preprocessor variables in wxs files (i.e. $(var.OtherProject.TargetPath)) that need to be resolved on a compilation step (candle.exe). So the post-build script is: rm $(Target); light obj\$(Configuration)\*.wixobj -ext WixBalExtension -out bin\$(Configuration)\$(SolutionName).exe – Ujin Oct 04 '13 at 11:46