7

I'm using a Visual Studio MSIX packaging project to create an installer on a network share for an internal application.

One problem is that it's creating a directory with "_Test" at the end.

Why is it doing that and how do I get rid of it? I just want "MyApp.MSIX_0.0.1.0", or ideally, "MyApp.0.0.1.0".

 Directory of I:\

08/14/2020  09:44 AM    <DIR>          .
08/14/2020  09:44 AM    <DIR>          ..
08/14/2020  09:44 AM            21,312 index.html
08/14/2020  09:23 AM               601 MyApp.MSIX.appinstaller
08/14/2020  09:37 AM    <DIR>          MyApp.MSIX_0.0.1.0_Test
               2 File(s)         21,913 bytes
               3 Dir(s)  62,444,621,824 bytes free

I've been scouring the documentation, but I can't find anything about the directories it creates or the index.html file it generates. I'd like to customize all that, add release notes, etc.

This is a WPF app, if that makes any difference.

Matt Gregory
  • 8,074
  • 8
  • 33
  • 40

3 Answers3

7

I am just placing here a copy of the original answer from MSFT:

The output directory of the packages is defined in the Microsoft.AppxPackage.Targets file at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage (depending on your version of Visual Studio).

If you want to remove the "_Test" suffix you can modify the lines defining the output directory. In my file it was around line 3190 - 3196:

enter image description here

To modify the output html file, modify the index.template.html file in the "Landing" subdirectory - C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Landing (depending on VS version).

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • This works on a developer machine. How do I fix it when deploying from Azure DevOps? – Rye bread Jun 23 '21 at 08:42
  • 1
    For Visual Studio 2022 Community the path is `C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Microsoft\VisualStudio\v17.0\AppxPackage` – Moshe Gutman Dec 17 '21 at 16:07
  • GIven that this is hard-coded in this system-wide file, I am just going to use a script to rename these after they are packaged. – Nacht Oct 14 '22 at 01:33
5

If you are using Azure Pipelines to deploy, you can add parameters to the MSBuild task to do this. For example:

Hardcoded:

task: MSBuild@1
    displayName: MSBuild
    inputs:
      solution: '**/*.sln'
      platform: 'x64'
      configuration: 'Release'
      msbuildArguments: '/p:OutDir=$(Build.BinariesDirectory)/    
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/MyApp_1.0.0/"'

or using pipeline variables:

msbuildArguments: 
 /p:OutDir=$(Build.BinariesDirectory)/
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/$(packageName)_$(newVersion)/"

This gives a folder called "MyApp_1.0.0" instead of the confusing "MyApp_1.0.0_Test".

And the Uri property inside the .appinstaller file will correctly point to this folder.

Rye bread
  • 1,305
  • 2
  • 13
  • 36
  • Very helpful! If you also want to edit the name of the file itself, you can use AppxPackageName. For example: `dotnet publish /p:AppxPackageTestDir="bin/Blah/net6.0-windows10.0.19041.0/win10-x64/AppPackages/MyApp_latest/" /p:AppxPackageName="MyApp_latest"` (If it matters, I ran this with dotnet publish in Github Actions instead of msbuild/Azure Pipelines, as in the answer above) – jobrien9 Jun 15 '23 at 18:12
0

For 2022 Professional, the file is: C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppxPackage.Targets