How to create a setup project using WiX to install two Visual Studio extensions

1.9k views Asked by At

I need to create a setup project using WiX to deploy two Visual Studio Extensions(vsix). I create a project follow the steps that you can see in this blog: Creating WiX setup for VSIX. I can compile the project and generate the .msi file, but when I am going to install the extensions, it gave me a runtime error, the error code is 2343. The XML of the WiX project is this:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:VSExtension="http://schemas.microsoft.com/wix/VSExtension"  xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Product Id="{77F7DB1E-6E8A-44DB-88FE-9E496B140A2C}" Name="Bpmn Studio" Language="1033" Version="1.0.0.0" Manufacturer="Cadic" UpgradeCode="8c57d4aa-2b56-4561-94dd-cf02b34a4747">
        <Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate EmbedCab="yes" VolumeLabel="Bpmn Studio"/>

        <PropertyRef Id="VS2013DEVENV"/>
        <Condition Message="Visual Studio 2013 needs to be intalled for this installation to continue.">
            <![CDATA[Installed OR VS2013DEVENV]]>
        </Condition>

        <!--Directory structure-->
        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
        <UIRef Id="WixUI_InstallDir" />
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="Casasoft" >
                </Directory>
            </Directory>
        </Directory>

        <Property Id="VSINSTALLDIR">
            <RegistrySearch Id="VSInstallRegistry" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\12.0" Name="InstallDir" Type="directory" />
        </Property>

        <CustomAction Id="SetVSIXInstaller" Return="check" Execute="immediate" Property="VSIXInstaller" Value="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe" />
        <CustomAction Id="DeployVSIX" Property="VSIXInstaller" Execute="deferred" Impersonate="no" ExeCommand="/quiet" Return="asyncWait"/>

        <InstallExecuteSequence>
            <Custom Action="DeployVSIX" After="MsiPublishAssemblies" />
        </InstallExecuteSequence>

        <Feature Id="BpmnStudio" Title="Bpmn Studio" Level="1">
            <ComponentRef Id="BpmnStudioExtensionVSPackage" />
        </Feature>

        <Feature Id="ProjectTypeFeature" Title="Bpmn Studio Project Type" Level="1">
            <ComponentRef Id="VSProjectTypePackage" />
        </Feature>

    </Product>

    <Fragment>
        <ComponentGroup Id="VSProjectTypeProductComponents" Directory="INSTALLFOLDER">
            <Component Id="VSProjectTypePackage" Guid="BD8BA9C9-3728-4847-8428-EBECE32F79DA">
                <VSExtension:VsixPackage File="VsBpmnStudioProjectTypeInstaller" PackageId="86e54529-745f-4b71-85f2-d2eb602bb777" Target="professional" TargetVersion="12.0" Vital="yes" Permanent="yes" />
                <File Id="VsBpmnStudioProjectTypeInstaller" Name="BpmnStudioProject.vsix" Source="D:\Work\DSL\2013\Bpmn Studio\Common\Setup\BpmnStudioProject\bin\Debug\BpmnStudioProject.vsix" />
            </Component>
        </ComponentGroup>   
    </Fragment>

    <Fragment>
        <ComponentGroup Id="BpmnStudioExtension" Directory="INSTALLFOLDER">
            <Component Id="BpmnStudioExtensionVSPackage" Guid="BD8BA9C9-3728-4847-8429-EBECE32F79DA">
                <VSExtension:VsixPackage File="VsPackageInstaller" PackageId="86e54529-745f-4b71-85f2-d2eb602bb767" Target="professional" TargetVersion="12.0" Vital="yes" Permanent="yes" />
                <File Id="VsPackageInstaller" Name="CasaSoft.BpmnStudio.DslPackage.vsix" Source="D:\Work\DSL\2013\Bpmn Studio\DslPackage\bin\Debug\CasaSoft.BpmnStudio.DslPackage.vsix" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>
1

There are 1 answers

1
ocuenca On BEST ANSWER

Hi Jason: I found the empty path,Is when I set the path where I want to install the extensions in the UI Interface. The Value INSTALLALLOCATION doesn't exist. I change this value for INSTALLFOLDER and now works as I want