Windows store apps APPXBUNDLE中的包APPX

Windows store apps APPXBUNDLE中的包APPX,windows-store-apps,electron,electron-builder,desktop-bridge,Windows Store Apps,Electron,Electron Builder,Desktop Bridge,我目前在Windows应用商店中提交了一个UWP应用程序,现在我想发布更新。此更新基于Electron,因此不再是UWP应用程序 我只想将Electron应用程序提交到Windows应用商店,但收到以下错误消息:此应用程序的上一次提交是使用Windows 10.msixbundle或.appxbundle发布的。后续提交的内容必须继续包含Windows 10.msixbundle或.appxbundle。 Electron应用程序由Electron builder打包,生成的文件是一个appx文

我目前在Windows应用商店中提交了一个UWP应用程序,现在我想发布更新。此更新基于Electron,因此不再是UWP应用程序

我只想将Electron应用程序提交到Windows应用商店,但收到以下错误消息:
此应用程序的上一次提交是使用Windows 10.msixbundle或.appxbundle发布的。后续提交的内容必须继续包含Windows 10.msixbundle或.appxbundle。

Electron应用程序由
Electron builder
打包,生成的文件是一个
appx
文件。之前我用Visual Studio打包了该应用程序,生成的文件是一个
appxbundle

根据此错误消息,我必须提交
.msixbundle
.appxbundle
文件。我可以创建一个包含Electron
.appx
文件的
.appxbundle
,然后将应用提交到Windows应用商店吗


谢谢

是的,您可以,这里有一篇来自MSFT的分步文章,介绍如何为现有的MSIX/appx包生成MSIX包


可以为Windows应用商店编译Electron应用程序。微软开发,使开发人员能够使用新的应用程序模型中的一些优点。新的.appx格式不仅支持许多新的强大API,如Cortana或推送通知,,而且通过Windows应用商店,还简化了安装和更新。您可以参考和了解详细的步骤和要求。

这里是我自己问题的承诺答案

正如我已经提到的,您必须坚持最初向Microsoft App Store提交应用程序的捆绑格式。所以在我的例子中,
.appxbundle

我使用的是
electron builder
,它会吐出一个
.appx
,然后我使用
afterAllArtifactBuildHook

这是位于我的electron项目的
build/hooks
文件夹中的
afterAllArtifactBuildHook.js
。它自动利用已缓存的
winCodeSign
工具,从
electron builder
中获取,确保所有内容都匹配

注意:这是一个面向Word macOS的功能性并行桌面安装,Windows 10已经设置为生成
.appx
文件

var path = require("path"),
    fs = require("fs"),
    glob = require("glob"),
    childProcess = require('child_process');

exports.default = function(buildResult) {
    buildResult.artifactPaths.forEach(function(appxPath) {
        if (appxPath.endsWith(".appx")) {
            convertAppx2AppxBundle(appxPath);
        }
    });
};

/**
 * Converts a Unix Path to a Windows conforming path by replacing any "/" with "\"
 * @return {string}
 */
String.prototype.windowsify = function windowsify() {
    return this.replace(/\//g, "\\");
}

/**
 * Converts the given appx to an appxbundle used for Windows Store submission
 * @note This function utalizes the parallels desktop tool "prlctl" to execute windows commands via macOS
 * @param appxPath
 */
function convertAppx2AppxBundle(appxPath) {
    try {
        console.log("Converting Appx to Appxbundle...")
        // We'll use electron-builder's winCodeSign tools which are conveniently already available in the following dir
        var electronBuilderDir = path.join(process.env.HOME, "Library/Caches/electron-builder"), // Don't use "~" it will just not work, trust me...
            // Will use the first matching windowsCodeSigning path as we may have multiple versions installed
            makeAppX = glob.sync(path.join(electronBuilderDir, "winCodeSign", "winCodeSign-*", "windows-10", "x64", "makeappx.exe"))[0],
            appxBundleMapFile = // This file is required by the makeappx.exe to generate the appxbundle
                '[Files]\n' +
                '"\\\\Mac\\AllFiles' + appxPath.replace(/\//g, "\\") + '"\t\t"Loxone.appx"';

        // Save the generated AppxBundle.map file to the filesystem to make it available for the Windows VM
        fs.writeFileSync(path.join(__dirname, "..", "AppxBundle.map"), appxBundleMapFile, { flag: "w" });

        var prlctlArgs = [
            'exec',
            '"Windows 10"', // the name of the specific Windows VM
            '--current-user', // We want to execute the following command with the current user
            // From this point on its the default Windows CLI command for converting an .appx to an .apppxbundle
            // Its important to know that these parts must conform to the Windows style, hence the windowsify function
            // We also need to use double quotation for the network shares due to how childProcess.execSync works...
            '"\\\\\\Mac\\AllFiles' + makeAppX.windowsify() + '"',
            'bundle',
            '/f',
            '"\\\\\\Mac\\AllFiles' + (__dirname.replace("/hooks", "") + "/AppxBundle.map").windowsify() + '"',
            '/p',
            '"\\\\\\Mac\\AllFiles' + appxPath.windowsify() + 'bundle"',
            '/o'
        ];
        // Now just execute the command to convert the appx to an appxbundle
        childProcess.execSync('prlctl ' + prlctlArgs.join(" "), { stdio: 'inherit' });
        console.log("Done converting Appx to Appxbundle");
    } catch (e) {
        console.warn("Couldn't convert appx two appxbundle!");
        console.error(e);
    }
}

我正在关注文档,但存在一些不一致之处。看起来不支持
/p
选项,我需要一个
打包布局文件
。有什么建议吗?对不起,我也不知道所有的细节。也许在MSFT的文章上留言,他们会回复你吗?这里还有一个关于软件包布局的帖子,可能会给你提供更多细节:我和一位微软技术支持人员聊天,他把我推向了正确的方向。我在创建
.appx
文件时没有遇到任何问题,但在将其提交到Windows应用商店时遇到了问题。如果您以前以捆绑表单提交了申请,那么看起来您需要坚持使用捆绑表单。不知何故,对这种行为的记录还不够充分。稍后我将用详细的指南回答我的问题。