fyne icon indicating copy to clipboard operation
fyne copied to clipboard

Failed to uplaod .appx packaged file to Microsoft Store

Open milkcoke opened this issue 1 year ago • 13 comments

Checklist

  • [X] I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • [X] This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

appxmanifest.xml

I made .appx package using fyne release CLI

This is example generated appxmanifest.xml on packaging processing

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
    <Identity Name="{{.AppID}}"
              Version="{{.Version}}"
              Publisher="{{.Developer}}" />
    <Properties>
        <DisplayName>{{.Name}}</DisplayName>
        <PublisherDisplayName>{{.DeveloperName}}</PublisherDisplayName>  <!-- ⚠️ 1. Error occurs here -->
        <Logo>Icon.png</Logo>
    </Properties>
    <Prerequisites>
        <OSMinVersion>6.0</OSMinVersion> <!-- ⚠️ 2. Error occurs here -->
        <OSMaxVersionTested>10.0</OSMaxVersionTested>
    </Prerequisites>
    <Resources>
        <Resource Language="en-us" />
    </Resources>

    <!-- <Applications>  ⚠️ 3. Error occurs-->
</Package>

1. PublisherDisplayName is not correct

In appxmanifest.xml is generated on release processing and which is deleted after .appx file is generated. However, PublisherDisplayName is determined on this code This format is forced to "CN={value}" but we just only input CLI the -developer CN=${value}, value is not the same of PublisherName in taht Microsoft store defined.

release.go

func (r *Releaser) nameFromCertInfo(info string) string {
	// format should be "CN=Company, O=Company, L=City, S=State, C=Country"
	parts := strings.Split(info, ",")
	cn := parts[0]
	pos := strings.Index(strings.ToUpper(cn), "CN=") // Just parse CN={value} but value is not the same in microsoft store defined. So error occurs.
	if pos == -1 {
		return cn // not what we were expecting, but should be OK
	}

	return cn[pos+3:]
}

2. OS Minversion is always 6.0

This is not changed on CLI, hardcoded as 6.0

3. <Application> tag is not defined

How to modify the tag information? that tag is required.

How to reproduce

CLI command

I try to packaging with the command

$ fyne release --target windows \
--appVersion 1.0.0 --appBuild 1 \
--appID [My-App-ID] \
--name [My-App-Name]
--icon [My-App-Icon-Path]
--developer "CN=[MyProductPublisherID]"  // ⚠️ Error occurs here too
--certificate [My-pfx-file]
-password [My-Password]

From this, generated .xml file is not appropriate to register on Microsoft Store as app package file

Screenshots

Product identity

Name, Publisher, PublisherDisplayName are already defiend , this is guided on Microsoft Partner Center > Apps and games > MyProduct image

Screenshots to upload .appx file

package_error_log

Example code

Refer to this code

There's no processing about <Application> tag And it seems that microsoft store .appx, .msix package just allow program entrypoint as C#, VisualBasic..

// ..
manifestData := struct{ AppID, Developer, DeveloperName, Name, Version string }{
  AppID: r.AppID,
  Developer:     r.developer,
  DeveloperName: r.nameFromCertInfo(r.developer), // ⚠️ here is problem
  Name:          r.Name,
  Version:       r.combinedVersion(),
}
err = templates.AppxManifestWindows.Execute(manifest, manifestData)
manifest.Close()
if err != nil {
  return errors.New("failed to write application manifest template")
}

// ..
util.CopyFile(r.icon, filepath.Join(payload, "Icon.png"))
util.CopyFile(r.Name, filepath.Join(payload, r.Name))

Fyne version

2.3.1

Go compiler version

1.20.1

Operating system and version

Windows 10

Additional Information

I tried many ways for publish my app on Microsoft store. However It seems that just C# , Visua basic program can be registerd succesfully on there.

This is the sample of AppxManifest.xml provided by Visual Studio.

<?xml version="1.0" encoding="utf-8"?>

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  IgnorableNamespaces="uap rescap">

  <Identity
    Name="[My App Name]"
    Publisher="CN=[My Publisher ID]"
    Version="1.0.0.0" />

  <Properties>
    <DisplayName>My App</DisplayName>
    <PublisherDisplayName>My Name</PublisherDisplayName>
	<Logo>Images\app_icon.png</Logo>
  </Properties>
	
	<Dependencies>
                <!-- also, MinVersion is just hard coded as 6.0.0.0 -->
		<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.0.0" MaxVersionTested="10.0.14393.0" />
	</Dependencies>
	
  <Resources>
	<Resource Language="x-generate" />
  </Resources>

  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="MyApp.App"> <!-- ⚠️ Here is also problem since EntryPoint is just allowed 'Main' method of C# -->
      <uap:VisualElements
        DisplayName="[My App]"
        Description="[My App Description]"
        BackgroundColor="transparent"
        Square150x150Logo="Images\Square150x150Logo.png"
        Square44x44Logo="Images\Square44x44Logo.png">
        <uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" >
          <uap:ShowNameOnTiles>
            <uap:ShowOn Tile="square150x150Logo"/>
          </uap:ShowNameOnTiles>
        </uap:DefaultTile >
        <uap:SplashScreen Image="Images\SplashScreen.png" />
        <uap:LockScreen BadgeLogo="Images\BadgeLogo.png" Notification="badge"/>
      </uap:VisualElements>
    </Application>
  </Applications>

  <Capabilities>
    <Capability Name="internetClient" />
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>
</Package>

I tried input <EntryPoint> main (go program) but it failed. Visual studio logging error as shown below image

It should be Main of C# (I guess)

Please confirm this process. That must be outdated. And is there any other solution? for packaging file for uploading microsoft store?

milkcoke avatar Mar 17 '23 13:03 milkcoke