YehudaKremer / msix

Create Msix installer for flutter windows-build files.
https://pub.dev/packages/msix
MIT License
280 stars 70 forks source link

Support whole icon asset folder as generated by Visual Studio #19

Closed technolion closed 3 years ago

technolion commented 3 years ago

:speech_balloon: Description

Currently msix only supports providing 3 images which get copied into the msix package:

In order to best show icons in Windows 10 multiple versions of these icons need to be copied into the msix package. Especially there need to be plated and unplated versions and sizes for different screens.

When creating all image assets with Visual Studio's Manifest Designer many different versions of the icons are created: assets

The corresponding references in Package.appxmanifest look like this:

   <Logo>Assets\StoreLogo.png</Logo>
      <uap:VisualElements
        DisplayName="App1"
        Square150x150Logo="Assets\Square150x150Logo.png"
        Square44x44Logo="Assets\Square44x44Logo.png"
        Description="App1"
        BackgroundColor="transparent">
        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="App1" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
        <uap:SplashScreen Image="Assets\SplashScreen.png" />
      </uap:VisualElements>

As you can see the icons in the Assets folder do not have the exact file names as provided in the manifest file. They are still found in they correct size and for the correct occasion. This also fixes the problem that icons are shown plated in the taskbar where you want to see them as unplated (without empty space around them) version.

So, it would be great, if this package would get an option to provide a complete Asset folder as created by Visual Studio which get's then copied into the msix package. The VisualElements section of Package.appxmanifest would then have to look similar like the above.

YehudaKremer commented 3 years ago

Hello Thomas, i added this feature to version 0.2.1-nullsafety.0, you can see documentation for this in the configuration table:

image

please update me if this working for you

Thank you for this feature suggestion

technolion commented 3 years ago

Yehuda, that's awesome. Thanks a lot! I'll try it out.

technolion commented 3 years ago

Unfortunately 0.2.1-nullsafety.0 has dependency conflicts with the package encrypt which our application also needs, so I cannot test at the moment. I asked the maintainer of encrypt to provide a null-safety version as well. So I will have to test this a little bit later.

Until then I have a quick question: Does the configuration option vs_generated_images_folder_path support building a file called resources.pri? This is necessary to support unplated (not on a colored plate with padding, but unpadded on transparent background) versions of the Windows 10 taskbar icons.

I had to spend half a day to find out, how that works. Here's my script that builds our flutter application and packages it into an msix. The folder windows\Assets contains all images created by Visual Studio like shown above.

flutter clean
flutter pub get
flutter build windows
cp windows\AppxManifest.xml build\windows\runner\Release\
cp windows\*.dll build\windows\runner\Release\
cp -r windows\Assets build\windows\runner\Release\
cd build\windows\runner\Release\
makepri createconfig /cf priconfig.xml /dq en-US
makepri new /pr . /cf priconfig.xml
cd -
makeappx.exe pack /d build\windows\runner\Release /p build\TeamBeam.msix
YehudaKremer commented 3 years ago

yes vs_generated_images_folder_path using makepri cli to create proper resources.pri file.

the change does, among other things, what your script does 👍

technolion commented 3 years ago

perfect, thx. I will close this issue, as soon as I can test it.

YehudaKremer commented 3 years ago

i now added this change to the main version 0.1.12 that dont need nullsafety, you can use it msix: 0.1.12.

technolion commented 3 years ago

I tested it and it works perfectly. Good work Yehuda, and thank you!