Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customizing Visual Studio MSIX packaging project output

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.

like image 366
Matt Gregory Avatar asked May 12 '26 20:05

Matt Gregory


2 Answers

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).

like image 130
Bogdan Mitrache Avatar answered May 14 '26 10:05

Bogdan Mitrache


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.

like image 33
Rye bread Avatar answered May 14 '26 10:05

Rye bread