Migrate Wix Project to version 4.0

2019-04-12 14:49发布

问题:

I recently ugraded Wix to Version 4.0.

After updating the namespaces Visual Studio (2015) won't recognize these new ones.

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <Product Id="*" Name="_any_name" Language="1033" Version="1.0.0.0" Manufacturer="Anyone" UpgradeCode="8c568038-54cf-43ff-aa2c-581f4dd0aea0" Codepage="1252">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <Feature Id="ProductFeature" Title="_any_title" Level="1">
        <ComponentGroupRef Id="group_ProductComponents" />
    </Feature>
    <Property Id="pro_SetupExe" Value="INSTALLFOLDER" />
    <CustomAction Id="ca_LaunchSetupExe" Property="pro_SetupExe" ExeCommand="/FORCE_HIDE_FIRST_RUN /UNATTENDED_INSTALL /AUTOACCEPT_ALL /FORCE_CLOSE_WHEN_DONE /ON_REBOOT_MESSAGE:”NO”" Execute="commit" />
    <CustomAction Id="ca_SetSetupPath" Property="pro_SetupExe" Value="[INSTALLFOLDER]x64ATIDriver\setup.exe" />
    <InstallExecuteSequence>
        <Custom Action="ca_SetSetupPath" Before="ca_LaunchSetupExe" />
        <Custom Action="ca_LaunchSetupExe" Before="InstallFinalize" />
    </InstallExecuteSequence>
    </Product>
    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="TempFolder">
                <Directory Id="INSTALLFOLDER" />
            </Directory>
        </Directory>
    </Fragment>
</Wix>

The Wix element has an incorrect namespace of 'http://wixtoolset.org/schemas/v4/wxs'. Please make the Wix element look like the following: Wix xmlns = "http://schemas.microsoft.com/wix/2006/wi"

I founde these: Migrate Wix Project to v4.0 instructions

But I don't get what this means:

Fix: Explicitly set absent Id attributes on File element to the Name attribute or filename from the Source attribute.

So currently I just have the kind of "crashed" project and can't build.

I'd really appreciate some help.

regards Muffex

回答1:

The namespace error makes it sound like the project is still being built by WiX v3. Also, that migrate to v4 page that you found is for the WixCop tool which automates everything you found there. It's in the bin directory of the WiX installation directory.