0

我需要使用 WiX 创建一个安装项目来部署两个 Visual Studio 扩展(vsix)。我按照您在此博客中看到的步骤创建了一个项目:为 VSIX 创建 WiX 设置。我可以编译项目并生成 .msi 文件,但是当我要安装扩展时,它给了我一个运行时错误,错误代码是 2343。WiX 项目的 XML 是这样的:

<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>
4

1 回答 1

0

嗨 Jason:我找到了空路径,是在我设置要在 UI 界面中安装扩展的路径时。值 INSTALLALLOCATION 不存在。我为 INSTALLFOLDER 更改了这个值,现在可以按我的意愿工作

于 2014-01-13T00:38:35.073 回答