[wix-users] Make WiX Project work in Visual Studio & Build Machine

Ven H venh.123 at gmail.com
Sat Dec 28 08:30:43 PST 2019


Thanks a lot for your help, Edwin. Please find the .wixproj and .targets
below.

*.wixproj*

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
InitialTargets="EnsureWixToolsetInstalled" xmlns="
http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == ''
">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>3.10</ProductVersion>
    <ProjectGuid>{9ecbe76b-ecc4-4a17-bc8b-f2224421f616}</ProjectGuid>
    <SchemaVersion>2.0</SchemaVersion>
    <OutputName>My.Custom.MSI</OutputName>
    <OutputType>Package</OutputType>
    <PublishDir>..\HeatFolder</PublishDir>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'
">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>Debug;HeatFldrPath=$(PublishDir)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>

<WixVariables>$(FilePath)=$(ProjectDir)HeatFolder;$(PVersion)="1.11.0.111"</WixVariables>

<DefineConstants>HeatFldrPath=$(FilePath);ProductVersion=1.11.0.111;BuildNumber=$(BldNum)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Full-Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>Release;HeatFldrPath=$(PublishDir)</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Content\GlobalCustomActions.wxs" />
    <Compile Include="Content\GlobalExitDlg.wxs" />
    <Compile Include="Content\GlobalFatalError.wxs" />
    <Compile Include="Content\GlobalInstallDlg.wxs" />
    <Compile Include="Content\GlobalLicenseAgreementDlg.wxs" />
    <Compile Include="Content\GlobalSetupFolderDlg.wxs" />
    <Compile Include="Content\GlobalWelcomeDlg.wxs" />
    <Compile Include="Content\GlobalWixUI.wxs" />
    <Compile Include="Content\Product.wxs" />
    <Compile Include="Content\UserFiles.wxs" />
    <Compile Include="Content\UserIIS.wxs" />
    <Compile Include="Content\UserRegistry.wxs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="conf\" />
    <Folder Include="Content\" />
    <Folder Include="Images\" />
    <Folder Include="lib\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="AppPoolAttrs.xml" />
    <Content Include="AppPoolUpgradeChanges.xml" />
    <Content Include="conf\default.yml" />
    <Content Include="Content\CustomActions.CA.dll" />
    <Content Include="Content\GlobalProperties.wxi" />
    <Content Include="Content\License.en-us.rtf" />
    <Content Include="CustomWix.targets" />
    <Content Include="Images\Banner.bmp" />
    <Content Include="Images\DEST.ICO" />
    <Content Include="Images\dialog.bmp" />
    <Content Include="Images\dialog_cust.bmp" />
    <Content Include="Images\dialog_template.bmp" />
    <Content Include="Images\Exclam.ico" />
    <Content Include="Images\folder.ico" />
    <Content Include="Images\folderNew.ico" />
    <Content Include="Images\New.ico" />
    <Content Include="Images\warn.ico" />
    <Content Include="lib\WixIIsExtension.dll" />
    <Content Include="lib\WixMsmqExtension.dll" />
    <Content Include="lib\WixUIExtension.dll" />
    <Content Include="lib\WixUtilExtension.dll" />
    <Content Include="packages.config" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Content\en-us.wxl" />
  </ItemGroup>
  <Import Project="CustomWiX.Targets"
Condition="Exists('CustomWiX.targets')" />
  <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != ''
" />
  <Import
Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets"
Condition=" '$(WixTargetsPath)' == '' AND
Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
  <Target Name="EnsureWixToolsetInstalled" Condition="
'$(WixTargetsImported)' != 'true' ">
    <Error Text="The WiX Toolset v3.11 (or newer) build tools must be
installed to build this project. To download the WiX Toolset, see
http://wixtoolset.org/releases/" />
  </Target>
</Project>

*.targets*

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>

<DefineConstants>HeatFldrPath=F;ProductVersion=1.11.0.345;BuildNumber=345</DefineConstants>

<OutputName>$(MSIName)</OutputName>
<OutputPath>$(MSIPath)</OutputPath>
<SuppressPdbOutput>True</SuppressPdbOutput>
  </PropertyGroup>
  <PropertyGroup>
<WixBinPath>$(SolutionDir)\Build\wix\</WixBinPath>
    <WixToolPath>$(WixBinPath)\</WixToolPath>
    <WixTargetsPath>$(WixToolPath)Wix.targets</WixTargetsPath>
    <WixTasksPath>$(WixToolPath)wixtasks.dll</WixTasksPath>
  </PropertyGroup>
  <ItemGroup>
    <WixExtension Include="WixUtilExtension">
      <HintPath>lib\WixUtilExtension.dll</HintPath>
      <Name>WixUtilExtension</Name>
    </WixExtension>
    <WixExtension Include="WixUIExtension">
      <HintPath>lib\WixUIExtension.dll</HintPath>
      <Name>WixUIExtension</Name>
    </WixExtension>
    <WixExtension Include="WixMsmqExtension">
      <HintPath>lib\WixMsmqExtension.dll</HintPath>
      <Name>WixMsmqExtension</Name>
    </WixExtension>
    <WixExtension Include="WixIIsExtension">
      <HintPath>lib\WixIIsExtension.dll</HintPath>
      <Name>WixIIsExtension</Name>
    </WixExtension>
  </ItemGroup>
  <Target Name="HeatTarget" BeforeTargets="Build">
<Exec  Command='"$(WixToolPath)\heat.exe" dir $(HeatFldrPath) -cg
UserFeatureFiles -dr APP_DIR -gg -g1 -sfrag -sw -svb6 -srd -sreg -ke -var
var.HeatFldrPath -out "Content\UserFiles.wxs"' />
  </Target>

</Project>

On Fri, Dec 27, 2019 at 11:42 PM Edwin Castro <egcastr at gmail.com> wrote:

> There is a good chance that using a Condition attribute in one or more
> places will likely help. It will likely need to look "normal" to Visual
> Studio while still have the ability to overwrite that default when running
> from command line without Visual Studio installed.
>
> Can you share your .wixproj and your .targets?
>
> --
> Edwin G. Castro
>
>
> On Fri, Dec 27, 2019, 07:36 Ven H via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
>> Let me give some more detail. In my WiX project, I need to run Heat
>> command
>> on a folder (not included in the project) and include the wxs content into
>> an empty file I have. Then I need to pass the name of the MSI (since it
>> should be configurable), the path of the MSI (since this also needs to be
>> configurable) and the Build Number (since this will be part of the MSI
>> name). I also need to pass the Product Version, since this will also have
>> Build number in it. Apart from this, I also need to pass the path of the
>> WiX binaries (downloaded). Even though, my machine has WiXToolSet
>> installed
>> and Votive is also installed, I need to be able to build this project
>> using
>> msbuild command. So, I have included all the above mentioned parameters as
>> properties (some as DefineConstants) in a separate targets file and have
>> imported this targets file into the wixproj file.
>>
>> I want to be able to build the MSI both from Visual Studio and also from
>> command line using MSBuild. But I am having a hard time getting both
>> working at the same time. Any help would be appreciated.
>>
>> On Fri, Dec 27, 2019 at 12:43 PM Ven H <venh.123 at gmail.com> wrote:
>>
>> > I have a setup project in Visual Studio 2019. I use Heat command in that
>> > project. I followed the below link to make it working in build machine,
>> > which won't have VS or WiXToolSet installed.
>> >
>> >
>> https://wixtoolset.org/documentation/manual/v3/msbuild/daily_builds.html
>> >
>> > For this, I modified the .wixproj as per the link above. But now, it's
>> no
>> > longer working in Visual Studio. Has anyone faced this issue? Has anyone
>> > had success in making a WiX project build successfully in  Visual
>> Studio as
>> > well as build machine? If so, please help.
>> >
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant
>> http://www.firegiant.com/
>>
>



More information about the wix-users mailing list