YehudaKremer / msix

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

[BUG] Display names can be longer than the valid shortName, but the two cannot be decouples. #178

Closed cppietime closed 1 year ago

cppietime commented 1 year ago

:information_source: Info

Version: 3.8.0

:speech_balloon: Description

The display_name attribute in pubspec.yaml maps to both the display name and short name in the app's manifest file, which is a problem when the display name is over 40 characters. When publishing to the Windows Store, the display name must exactly match the app name, so it cannot always be shortened. If it were possible to specify a separate shortname in addition to the display name, this issue could be avoided.

Below is an example output from this error occurring:

Option /v specified, switching to verbose output.
Option /o specified, existing files will be overwritten.
Using default hash method: SHA256.
The path (/p) parameter is: "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release\test_app.msix"
The content directory (/d) parameter is: "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release"
Enumerating files from directory "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release"
Packing 76 file(s) in "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release" (content directory) to "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release\test_app.msix" (output file name).
Memory limit defaulting to 8505649152 bytes.
Using "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release\AppxManifest.xml" as the manifest for the package.
MakeAppx : error: Failure at appxFactory->CreateManifestReader(manifestStream, &manifestReader) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
MakeAppx : error: Error info: /*[local-name()="Package" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"]/*[local-name()="Applications" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="Application" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/foundation/windows10"][1]/*[local-name()="VisualElements" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/uap/windows10"][1]/*[local-name()="DefaultTile" and namespace-uri()="http://schemas.microsoft.com/appx/manifest/uap/windows10"][1]/@ShortName
Union doesn't support this value.
The attribute 'ShortName' with value 'MSIX Flutter Test #0 - Yaakov Schectman - 2/23' failed to parse.
Cleaning up output file "\\?\D:\Projects\flutter\test_app\build\windows\runner\Release\test_app.msix".
MakeAppx : error: Failure at (CreatePackage( overwrite, hashAlgorithm, fileList, outputPath, manifestStream.Get(), forceCompressionNone, performanceOptions, encryptPackage, encryptionOptions, cgmPath, mainPackagePathForResourceExemption, makepriExeFullPath)) - 0x80080204 - The specified package format is not valid: The package manifest is not valid.
MakeAppx : error: Package creation failed.
MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.

:scroll: Pubspec.yaml

name: test_app
description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: '>=2.18.5 <3.0.0'

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.0
  msix: ^3.8.0

flutter:

  uses-material-design: true

msix_config:
  certificate_path: C:\users\alpac\CERTIFICATE.pfx
  certificate_password: password
  publisher_display_name: YaakovSchectman
  publisher: CN=0212DB11-B47A-4163-852E-6EABD99F7886
  identity_name: 24931YaakovSchectman.MSIXFlutterTest0-YaakovSchect
  store: true
  display_name: "MSIX Flutter Test #0 - Yaakov Schectman - 2/23"
  # Could we add a short name field here?
YehudaKremer commented 1 year ago

Hello @cppietime

Thank you for reporting this bug, I publish a new version (3.8.1) with a fix for that.