msbuild,wix,installer , WiX error build target


WiX error build target

Question:

Tag: msbuild,wix,installer

I'm trying to create my MSI setup with WiX and MSBuild command which deploy my img.png into a repertory and i have this error :

"MSB4019: project imported "C:\Program Files\MSBuild\Microsoft\WiX\v[[Version.M ajor]].x\Wix.targets" was not found. " Make sure that path of declaration are correct

In this line :

<Import Project="$(WixTargetPath)" />

Here my 2 files (test.wixproj and test.wxs) :

test.wixproj

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <PropertyGroup>
                <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
                <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
                <ProductVersion>3.0</ProductVersion>
                <ProjectGuid>{}</ProjectGuid>
                <SchemaVersion>2.0</SchemaVersion>
                <OutputName>WixProject1</OutputName>
                <OutputType>Package</OutputType>
                <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v[[Version.Major]].x\Wix.targets</WixTargetsPath>
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
                <OutputPath>bin\$(Configuration)\</OutputPath>
                <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
                <DefineConstants>Debug</DefineConstants>
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
                <OutputPath>bin\$(Configuration)\</OutputPath>
                <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
        </PropertyGroup>
        <ItemGroup>
                <Compile Include="C:\testW2.wxs" />
        </ItemGroup>
        <Import Project="$(WixTargetsPath)" />
    </Project>

test.wxs

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" UpgradeCode="" Version="1.0.0.0" Language="1033" Name="My Application Name" Manufacturer="My Manufacturer Name">
        <Package InstallerVersion="300" Compressed="yes"/>
        <Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />


        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="APPLICATIONROOTDIRECTORY" Name="Application test"/>
            </Directory>
        </Directory>


        <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
            <Component Id="myimg" Guid="">
                <File Id="myimg" Source="C:\img.png" KeyPath="yes" Checksum="yes"/>
            </Component>

        </DirectoryRef>


        <Feature Id="MainApplication" Title="Main Application" Level="1">
            <ComponentRef Id="myimg" />
        </Feature>
    </Product>
</Wix>

I don't unstandand where is the problem and i don't find an easy tutorial on WiX without VisualStudio.

Can you help me ?


Answer:

There are two problems with your project file:

  1. The <WixTargetPath ...> line [[MajorVersion]] should be replaced with '3',
  2. The <Compile...> line should to refer to the correct file 'Test.wxs'.

Try this project file:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
            <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
            <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
            <ProductVersion>3.0</ProductVersion>
            <ProjectGuid>{}</ProjectGuid>
            <SchemaVersion>2.0</SchemaVersion>
            <OutputName>WixProject1</OutputName>
            <OutputType>Package</OutputType>
            <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
            <OutputPath>bin\$(Configuration)\</OutputPath>
            <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
            <DefineConstants>Debug</DefineConstants>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
            <OutputPath>bin\$(Configuration)\</OutputPath>
            <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    </PropertyGroup>
    <ItemGroup>
            <Compile Include="test.wxs" />
    </ItemGroup>
    <Import Project="$(WixTargetsPath)" />
</Project>

You also need to make sure test.wxs has a GUID in the UpgradeCode attribute.


Related:


WiX error build target


msbuild,wix,installer
I'm trying to create my MSI setup with WiX and MSBuild command which deploy my img.png into a repertory and i have this error : "MSB4019: project imported "C:\Program Files\MSBuild\Microsoft\WiX\v[[Version.M ajor]].x\Wix.targets" was not found. " Make sure that path of declaration are correct In this line : <Import Project="$(WixTargetPath)" />...

Trigger uninstall and Repair of previously installed product


wix,windows-installer,wix3.8
i am new to Wix toolsets. i have successfully made my first installer in Wix but now i am confused about my software updates which usually are minor. in my installer i want to check if user have any older version installed then i want to show him three options...

Binary files copied to a wrong folder on build


msbuild,appharbor,post-build-event,libgit2sharp
Recent libgit2sharp Nuget uses a new Nuget feature that allows you to include a piece of a build script in your NuGet. The purpose it to copy a native dll to a subfolder of the bin folder, like that: <ItemGroup> <None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-e0902fb.dll"> <Link>NativeBinaries\amd64\git2-e0902fb.dll</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None>... Now, it was all nice...

Include file in solution explorer without it being a build dependency


c#,visual-studio,msbuild,intellisense
How can I include a file in the list of files in solution explorer without including it as a dependency for compilation? I have a .targets file that generates .cs files, similar to the examples in this answer. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <CoreCompileDependsOn>$(CoreCompileDependsOn);GenerateCode</CoreCompileDependsOn> </PropertyGroup> <ItemGroup> <Sources Include="..\sources\*.txt" /> </ItemGroup> <Target Name="GenerateCode"...

Relationship between SonarQube Runner and SonarQube.MSBuild.Runner


tfs,msbuild,sonarqube,sonar-runner
Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it.

Namespace prefix 'bal' is not defined


wix
I've got this error. Since I put below code in the Bundle.wxs. <BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.Hyperlink2License"> <bal:WixExtendedBootstrapperApplication ThemeFile="Resources\COTheme.xml" LicenseUrl="http://xxxxxx /> </BootstrapperApplicationRef> Could please anyone help me?...

Emulate Devenv/Runexit under MSBuild


visual-studio,msbuild,build-automation
I am new to MSBuild and busy automating tests of Visual Studio solutions. I previously worked with the command line of Devenv, which provides a convenient /Runexit mode of operation. From the manual: /Runexit (devenv.exe) Compiles and runs the specified solution, minimizes the IDE when the solution is run, and...

Elastic Bamboo CI Windows Server - MSBuild 12 not publishing


c#,visual-studio,visual-studio-2012,msbuild
I have a custom image with Node.js, Microsoft Build Tools 2013, Windows SDK for Windows 8.1, .Net Framework 4.5.1 SDK, Microsoft Test Controller for Visual Studio 2013, Microsoft Agents for Visual Studio 2013 and Microsoft Web Deploy 3.5 installed. Most things are working but I am struggling to get the...

Release Management for Visual Studio 2013 - Release Exception


visual-studio,tfs,msbuild,release-management,ms-release-management
Getting the following error after a successful MsBuild on a TFS Build Server: ERROR: Value cannot be null. Parameter name: The attribute 'BuildNumber' is not part of this XElement at Microsoft.TeamFoundation.Release.Common.ExtensionMethods.XmlExtensionMethods.GetAttributeValue(XElement element, XName attributeName) at Microsoft.TeamFoundation.Release.Data.Model.ReleaseComponent.SetBuildToLatest() at Microsoft.TeamFoundation.Release.Workflow.Services.ReleaseWorkflowService.InitiateFromBuild(Uri teamFoundationServerUrl, String...

executing an vb script from another project bud in the same solution in C#


c#,vb.net,wix
i am trying to call a VB script that i made that in the same solution bud in another project, it is a C# project with windows forms and WIX. i am building an .MSI installer and when i arrive at a certain form i want it to execute a...

Creating a silent installer for a MSI


wix,nsis,msiexec,silent-installer
What is the best way to make a silent installer (or unattended) for a program that was already created and has a msi installer? At work I'm told to create an installer that is automated and does all the interaction with the user automatically so that the user essentially just...

Can't build a project with Postsharp 4.1.14


c#,.net,msbuild,nuget,postsharp
I have a project which references a postsharp 4.1.14. When I build a project the error occurred. Postsharp is installed by nuget package. There is .net version 4.0 installed on computer, but Microsoft.Build.Utilities.ToolLocationHelper.GetPlatformSDKLocation method is from .net 4.5. Can I use different version of postsharp? Is there another way to...

TFS Build - Get Assembly Version Info


visual-studio,tfs,build,msbuild
Is there a simple way to set the TFS Build Number to be an Assembly Version during build? I've seen many examples of the other way around (i.e. a build number updates the assembly version). We already use the SharedAssemblyInfo implementation from here, so we would like to leverage this...

Should a WiX web installer and stand-alone installer both show up in Add/Remove programs?


wix,wix3.9
We have two WiX installers that use our own BA. One installer gets all the packages from the web, while the other gets all the packages from the exe. We call them "Web" and "Full" installers. We have a case where a user might install one package from the web...

How do i have a .csproj build a .proj file before building itself?


c#,msbuild
I have a .csproj file and a .proj file. As part of my .proj file I am generating a file to include in the .csproj, so the .proj needs to run first. How can this be done. I originally tried to add a project reference as follows: <ProjectReference Include="..\FileGenerator\FileGenerator.proj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>...

How to change $(var.Platform) from x86 to Win32 in Wix


c++,wix,platform
I have a Visual C++ 2013 solution including many C++ projects and a WIX installer project. On x64 platform, everything is okay. But On x86 platform, $(OutDirectory)$(Platform)$(Configuration) of C++ projects is ...Win32..., but $(OutDirectory)$(Platform)$(Configuration) of WIX is ...x86... What can I do?

Unused results from Entity Framework database call


c#,entity-framework,msbuild,dbcontext,compiler-optimization
Any decent compiler should eliminate dead code, at least to a certain extent. However, I am curious how a compiler (specifically MSBuild) handles a situation like the following: // let's assume LazyLoadingEnabled = false; var users = db.Users.ToList(); // more code that never touches 'users' Since LazyLoadingEnabled = false, will...

msbuild set path to CL


visual-studio,msbuild,clang
I'm trying to take a couple of projects normally compiled on Windows with Microsoft C++ and compile them with clang instead. On the upside, there exists clang-cl.exe which is designed to be a drop-in replacement for cl.exe. However, even when I copy clang-cl.exe into the current directory as cl.exe, msbuild...

How to add assemblies to WiX toolset setup, which comes from a nuget package?


c#,.net,wix
I use the Votive-project type to create a setup with the WiX toolset. I know, that I can add an assembly like this to the setup: <File Id="FILE_myproject.dll" Source="$(var.myproject.TargetPath)" KeyPath="yes" /> What I don't know is, how can I add referenced assemblies to the setup, which comes in a nuget...

How to launch executable after installation (exe is delivered by .msm)


wix,custom-action
I did everything as explained in tutorial, but my executable wasn't launched after product installation completed. There is a nuance that my executable is delivered with .msm module, so in .wxs file for .msi I do the following to launch application: <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product> <!-- I omit here features and...

Change Wix Product version number using NANT XmlPoke


build,wix,nant,wix3.9
I ran into this issue recently - when I try to replace the Wix Product version number using NANT XMLPOKE task, it returns the following error message "No matching nodes found". <xmlpoke file="..\Setup\abc.wxs" xpath="//Wix/Product[@Version]" value="${version.label}" > Initially I thought that this was an issue with XPATH statement that I wrote....

How to change text style of the Title & Description text controls of a WiX dialog?


wix
Where can I find information of the Style values for a text control of a WiX dialog? For example, the default text style used for the WiX dialog Title control is {\WixUI_Font_Title} & I would want to use the same style but to change the color to White. For the...

Is Component/@Guid attribute is a MUST in case of producing MergeModule


wix
In my .wxs file for components, there are only components with single file, and this is the case for generatable GUIDs. But it seems to me that for .msm (merge module), component's GUID should be explicitly specified. Or I'm free to use Guid="*" and that would be OK? I tried...

Is it possible to write build message from powershellscript?


powershell,msbuild,tfsbuild
If i have a build template for TFS, and in this template in post-build script row i make a call to a powershell script, are there any way to transfer output from this PS script to build log?

CodeContracts fails the build for seemingly no reason


c#,.net,msbuild,code-contracts
I have a C# PCL project that uses code contracts. However on TeamCity the project fails to build, but it looked like the build was successful locally. However the build log does claim that the build did fail, but it gives no reason at all. 'Fail build on warnings' is...

Deploy Any CPU build with WiX to x86 using MSBuild


visual-studio-2013,tfs,msbuild,wix
I have a set of solutions that build a complete .NET Any CPU application. I have a WiX project that will deploy that application as x86 and I can run this all manually in Visual Studio 2013 without any issues. Now I'm trying to get this to work in MSBuild...

SHFileOperation cannot remove folder


c++,wix
I am writing a C++ Custom action for WiX that will be called during installation to remove any leftovers installed by the installer. Consider the following code: UINT __stdcall DeleteResidue(MSIHANDLE hInstall) { HRESULT hr = S_OK; UINT er = ERROR_SUCCESS; LPWSTR lpFolderPath = NULL; std::wstring temp; SHFILEOPSTRUCT shFile; hr =...

Octopack for .Net 2.0 and msbuild 2.0


msbuild,octopus-deploy,octopack
I was setting up number of projects to build NuGet packages and push onto NuGet server, so it could be later used by Octopus Deploy. All was fine until I needed to apply the same process to legacy projects. The error was: error MSB4062: The "OctoPack.Tasks.CreateOctoPackPackage" task could not be...

New Automatic NuGet package resotore and NuGet.Config


.net,visual-studio-2013,msbuild,nuget,nuget-package-restore
I'm migrating to new version of Automatic package restore as described in docs This documents says, that .nuget folder should be removed completely. Including NuGet.Config, that contained a property, we need: <config> <add key="repositoryPath" value="..\..\..\commonNugetPackages" /> </config> So how one should specify path where packages should be restored? Update: Updating...

WIX XMLConfig Different Root Element Names


wix
I'm running into an odd issue with a "config" msi I'm writing in WIX that uses XMLConfig to check for, delete and then create the new values in a single xml file. Since I Discovered WIX I've been packaging a lot of our manual configuration processes so this is my...

Service dependencies are causing my wix msi to force a reboot on uninstall


wix,windows-installer
I have spent the past 3 days running in-place while tracking down the cause of forced reboots on my system, but have finally narrowed it down to a very specific cause. I have a service suite that I am working on in Wix. There are 10 msi's that are all...

How to change Install button display text conditionally


wix,windows-installer,wix3.8
Is it possible to change the "Install" button display text based on some condition i.e if fresh install then "Install" if upgrade then "Update"? Basically, on major upgrade i am skipping some of my custom dialogs (which are shown on fresh installation) so on InstallReady dialog i want to show...

MSBuild Error: “The solution file has two projects named …”


visual-studio-2013,msbuild,publish-profiles
I'm trying to figure out how to make MSBuild work so I can set up automated builds and would appreciate some help with this weird error. I'm using Visual Studio 2013, and a Web Application project. The solution has 8 different class libraries. I've got several Publish Profiles set up...

Reading msbuild syntax


c#,msbuild,msbuild-task
I've run across msbuild syntax that I don't understand. The following snippet is from another question about making a custom msbuild task <GenerateDesignerDC InputFiles="@(dbml)" OutputFiles="@(dbml->'$(IntermediateOutputPath)%(FileName).designer.cs')"> ... What does @(dbml->'$(IntermediateOutputPath)%(FileName).designer.cs') mean? The @ sign usually references the files in an ItemGroup; what does the -> arrow inside an @(...) mean? What...

Error allocating file install folder in WIX 3.9


directory,wix,windows-installer
I am setting up the installation locations for my installer. However, it throws an error when I try to set the locations. Source code: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="Wix_setup" Language="1033" Version="1.0.0.0" Manufacturer="Frank Jansen" UpgradeCode="37a42e55-dea8-47da-8f4f-fb065dd38a9e"> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="A newer version of...

How do ASP.NET Web APIs work once built with MSBUILD?


c#,asp.net,msbuild
I'm new to coding and spend most of my time in mobile application development with Phonegap, I've been learning how to code ASP.NET Web APIs and I know how it generally all works while having the code open in front of me but --- I was asked a question today...

Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines


msbuild,certificate,clickonce,cruisecontrol.net,signing
After discovering the signing issue with .NET 4.5 vs .NET 4.0 when upgrading from an SHA1 to an SHA256 signed certificated, I decided to re-implement our ClickOnce build process to follow a more standard approach so I could make use of VS2013 Update 3. However it didn't seem to have...

vstest.console.exe not generating trx file, TestResults empty


msbuild,mstest,xunit,vstest,visual-studio-test-runner
I am trying to run below command on my build server, c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\UnitTest\MyTests.dll" /settings:"C:\UnitTest\output.runsettings" /UseVsixExtensions:"true" /InIsolation /Logger:"trx" <?xml version="1.0" encoding="UTF-8"?> <RunSettings> <RunConfiguration> <ResultsDirectory>.\TestResults</ResultsDirectory> </RunConfiguration> </RunSettings> It generates TestResults folder which...

Single Package Authoring


wix,windows-installer
I am trying to create Single Package Authoring installation using following tutorial - http://www.egoroff.spb.ru/blog/62003.html Main wix file is following: <?xml version='1.0' encoding='windows-1252'?> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> <Product Name='Foobar 1.0' Id='GUID' UpgradeCode='GUID' Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'> <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer" Comments='Foobar is a registered trademark of Acme Ltd.'...

WiX – copy arbitrary files


c#,wix
The folder where my setup.exe is located contains a subfolder CALhaving files named something like xyz1234.cal – their names vary from customer to customer. These files have to be copied into a folder CAL in the target directory. So I created a CustomAction and a C# dll which uses the...

How do I install the Wix extension on after a Visual Studio 2013 Update?


visual-studio-2013,wix
I have installed Wix 3.9 on VS 2012. Recently, I just got VS 2013 and I am not sure how to install just the extension on there? How do I do without uninstalling wix 3.9 and reinstalling it back again?...

Cant find File System, Registry icon in WIX setup project in Visual Studio


visual-studio-2012,wix
I installed WIX in my machine. I followed the video of https://www.youtube.com/watch?v=CoFPyIbcqN8enter link description here I can not find any way to add File Systems, no icon for it, no context menu entry on project. I am using Visual Studio 2012....

WIX-Installer ServiceControl “sufficient privileges” error


c#,windows-services,wix,installer,visual-studio-2015
Visual Studio 2015 RC Wix v3.10.0.1726 I am creating a installer for a windows services. I've tested the service with InstallUtil and it runs fine. Unfortunately I'm having a bit of troubles with wix, here is the exact error - "Service 'Service Name' failed to start. Verify that you have...

How to define WIX agent requirment in TeamCity?


msbuild,wix,teamcity
I have add a WIX installer project to solution in Visual Studio 2013. The project is built with every commit on TeamCity. There are several build agents connected to TeamCity cloud, but only some have WIX installed. Usually I would add the build agent requirement, so only the computer with...

error MSB4062: The “MSBuild.ExtensionPack.Web.Iis7Application” task could not be loaded from the assembly MSBuild.ExtensionPack.Iis7.dll


c#,msbuild
Receiving this error when trying to build my application using msbuild: error MSB4062: The "MSBuild.ExtensionPack.Web.Iis7Application" task could not be loaded from the assembly MSBuild.ExtensionPack.Iis7.dll. Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask>...

command line Start.Info.Argument error


c#,command-line,wix,heat
I would like run this command with C# : "%WIX%/bin/heat.exe" dir "C:\Documents and Settings\APP" -gg -sfrag -cg Appli -out wixappli.wxs I have this code (Program.cs) : System.Diagnostics.Process process1 = new System.Diagnostics.Process(); process1.StartInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe"); process1.StartInfo.Arguments = String.Format("/k \"%WIX%/bin/heat.exe\" dir \"{0}\" -gg -sfrag -cg Appli -out wixappli.wxs ", @"C:\Documents and...

Msbuild now to conditionally use one of two targets with same name


visual-studio,msbuild
I've seen some answers to a similar question but not exactly the same and not with positive luck trying to use suggested solutions... so I'm trying something like this: <project> <target name="foo" Condition="'$(Configuration)' == 'Debug' "> <Message Text="=== RUNNING FOO DEBUG TARGET ===" /> </target> <target name="foo" Condition="'$(Configuration)' == 'Release'...