jm-tech-power-official/Flash Download
A desktop download manager that opens up to 32 connections against one file and can send each of them out a different proxy route.
Public
Uncategorized
Clone
jm-tech-power-official/flash-download.jmproj
build/check-appx-identity.js
'use strict';
/**
* The Microsoft Store rejects a package whose identity does not match the one
* reserved in Partner Center, and electron-builder will happily build with
* whatever is in package.json. Fail loudly instead of producing an .appx that
* cannot be submitted.
*/
const path = require('path');
const { appx } = require(path.join(__dirname, '..', 'package.json')).build;
const problems = [];
if (!appx) problems.push('build.appx is missing entirely.');
else {
if (/PLACEHOLDER/i.test(appx.identityName || '')) {
problems.push(`identityName is still a placeholder (${appx.identityName}).\n` +
' Partner Center > your app > Product identity > "Package/Identity/Name".');
}
if (/PLACEHOLDER/i.test(appx.publisher || '')) {
problems.push(`publisher is still a placeholder (${appx.publisher}).\n` +
' Partner Center > your app > Product identity > "Package/Identity/Publisher" (the full CN=... string).');
}
if (appx.publisher && !/^CN=/.test(appx.publisher)) {
problems.push(`publisher must start with "CN=" (got ${appx.publisher}).`);
}
if (appx.applicationId && !/^([A-Za-z][A-Za-z0-9]*)(\.[A-Za-z][A-Za-z0-9]*)*$/.test(appx.applicationId)) {
problems.push(`applicationId "${appx.applicationId}" is invalid: dot-separated segments, each starting with a letter.`);
}
}
if (process.platform !== 'win32') {
problems.push('The appx target only builds on Windows. electron-builder refuses up front:\n' +
' "AppX is supported only on Windows 10 or Windows Server 2012 R2 (version 6.3+)".');
}
if (problems.length) {
console.error('\n Cannot build the Microsoft Store package yet:\n');
for (const p of problems) console.error(` • ${p}`);
console.error('');
process.exit(1);
}
console.log(' appx identity looks submittable.');