dorssel / usbipd-win

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2.
GNU General Public License v3.0
3.57k stars 229 forks source link

Wix version #961

Open d0n13 opened 4 months ago

d0n13 commented 4 months ago

When I download the project to build manually I notice the installer is shown as incompatible.

I’ve installed Wix toolset 4 and 5 but neither seem to make this work.

How do I install the wix toolset for this project?

thanks Donie

dorssel commented 4 months ago

You don't need to install any Wix toolset. Just follow the build steps in https://github.com/dorssel/usbipd-win/blob/master/.github/workflows/build-installer.yml.

d0n13 commented 4 months ago

You don't need to install any Wix toolset. Just follow the build steps in https://github.com/dorssel/usbipd-win/blob/master/.github/workflows/build-installer.yml.

I have this in VS 2022. It worked from command line but how can I edit the files as this is hiding them...

image

Here is the project file for Installer if you double click the project. Is there something in here that breaks it?

<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2020 Frans van Dorsselaer

SPDX-License-Identifier: GPL-3.0-only
-->
<Project Sdk="WixToolset.Sdk">
  <PropertyGroup>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <GenerateGitVersionInformation>false</GenerateGitVersionInformation>
    <UpdateAssemblyInfo>false</UpdateAssemblyInfo>
    <OutputName>usbipd-win</OutputName>
    <PublishDir>..\Usbipd\bin\publish</PublishDir>
    <PowerShellDir>..\Usbipd.PowerShell\bin\$(Configuration)\netstandard2.0</PowerShellDir>
    <DefineConstants>PublishDir=$(PublishDir);PowerShellDir=$(PowerShellDir);DriversDir=..\Drivers;Copyright=$(Copyright)</DefineConstants>
    <Pedantic>true</Pedantic>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="WixToolset.Firewall.wixext" />
    <PackageReference Include="WixToolset.UI.wixext" />
    <PackageReference Include="WixToolset.Util.wixext" />
  </ItemGroup>
  <Target Name="SetTarget" AfterTargets="GetVersion">
    <!--
    Now that we have determined the version, augment the OutputName to include the version number.
    -->
    <Message Importance="high" Text="Version detected as $(GitVersion_FullSemVer)" />
    <CreateProperty Value="$(OutputName)_$(GitVersion_MajorMinorPatch)">
      <Output TaskParameter="Value" PropertyName="TargetName" />
    </CreateProperty>
    <CreateProperty Value="$(TargetName)$(TargetExt)">
      <Output TaskParameter="Value" PropertyName="TargetFileName" />
    </CreateProperty>
    <CreateProperty Value="$(TargetDir)$(TargetFileName)">
      <Output TaskParameter="Value" PropertyName="TargetPath" />
    </CreateProperty>
    <CreateProperty Value="$(TargetName).wixpdb">
      <Output TaskParameter="Value" PropertyName="TargetPdbFileName" />
    </CreateProperty>
    <CreateProperty Value="$(TargetPdbDir)$(TargetPdbFileName)">
      <Output TaskParameter="Value" PropertyName="TargetPdbPath" />
    </CreateProperty>
    <!--
    This ensures that each x.y.z version has a different ProductCode, so every update is a MajorUpgrade.
    It also ensures that 2 builds of the same x.y.z version will never be installed simultaneously.
    The alternative (WiX AllowSameVersionUpgrades) causes ICE61.
    -->
    <CreateProperty Value="$(DefineConstants);ProductCode=EA1D5623-E6A7-4E4A-9259-E39722$([System.Byte]::Parse($(GitVersion_Major)).ToString(X2))$([System.Byte]::Parse($(GitVersion_Minor)).ToString(X2))$([System.Byte]::Parse($(GitVersion_Patch)).ToString(X2))">
      <Output TaskParameter="Value" PropertyName="DefineConstants" />
    </CreateProperty>
  </Target>
  <Target Name="PublishUsbipd" BeforeTargets="BeforeBuild">
    <Message Importance="high" Text="Publishing pre-built usbipd-win" />
    <RemoveDir Directories="$(PublishDir)" />
    <MakeDir Directories="$(PublishDir)" />
    <Exec Command="dotnet publish --nologo --no-restore --no-build --framework $(MainTargetFramework) ..\Usbipd" />
  </Target>
</Project>
dorssel commented 4 months ago

For VS you need the "HeatWave for VS2022" extension from FireGiant (the makers of WiX).