Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ npm install electron-windows-msix --save-dev
WindowsKitPath is provided then the Windows Kit path will be derived from the S Version specified in AppManifest.xml.
windowsKitPath - An optional full path to the WindowsKit. This path will trump both WindowsKitVersion and AppxManifest.
createPri - Indicates whether to create Pri resource files. It is enabled by default.
priConfig - Optional path to priconfig.xml. If not set then one will be generated with `makepri createconfig`. Does nothing when createPri is false.
sign - Optional parameter that indicates whether the MSIX should be signed. True by default.
windowsSignOptions - Optional parameter for `@electron/windows-sign`, missing will be filled in. See https://github.com/electron/windows-sign for details
logLevel - Optional log level. By default the module will be silent. The 'warn' level will give heads up on irregularities.
Expand Down
10 changes: 5 additions & 5 deletions src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export const getCertPublisher = async (cert: string, cert_pass: string) => {
}

export const priConfig = async (program: ProgramOptions) => {
const { makePri, priConfig, createPri } = program;
if(createPri) {
const args = ['createconfig', '/cf', priConfig, '/dq', 'en-US'];
const { makePri, priConfigPath, createPriConfig, createPri } = program;
if(createPri && createPriConfig) {
const args = ['createconfig', '/cf', priConfigPath, '/dq', 'en-US'];
log.debug('Creating pri config.')
await run(makePri, args);
} else {
Expand All @@ -78,10 +78,10 @@ export const priConfig = async (program: ProgramOptions) => {
}

export const pri = async (program: ProgramOptions) => {
const { makePri, priConfig, layoutDir, priFile, appManifestLayout, createPri } = program;
const { makePri, priConfigPath, layoutDir, priFile, appManifestLayout, createPri } = program;
if(createPri) {
log.debug('Making pri.')
const args = ['new', '/pr', layoutDir, '/cf', priConfig, '/mn', appManifestLayout, '/of', priFile, '/v'];
const args = ['new', '/pr', layoutDir, '/cf', priConfigPath, '/mn', appManifestLayout, '/of', priFile, '/v'];
await run(makePri, args);
} else {
log.debug('Skipping making pri.');
Expand Down
5 changes: 4 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export interface PackagingOptions {
windowsKitPath ? : string;
/** Indicates whether to create Pri resource files. It will be enabled by default. */
createPri ? : boolean;
/** Optional path to priconfig.xml. If not set then one will be generated with `makepri createconfig`. Does nothing when createPri is false.*/
priConfig ? : string;
/**
* Indicates whether to sign the MSIX package. It will be enabled by default. If cert or signParams are not provided then the package will be signed with a dev cert.
* If sign is false then the package will not be signed.
Expand Down Expand Up @@ -144,7 +146,8 @@ export interface ProgramOptions {
cert_cer: string;
cert_pass: string;
createPri: boolean;
priConfig: string;
createPriConfig: boolean;
priConfigPath: string;
priFile: string;
isSparsePackage: boolean;
sign: boolean;
Expand Down
8 changes: 5 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ export const makeProgramOptions = async (options: PackagingOptions, manifestVars
const appManifestLayout = path.join(layoutDir, `AppxManifest.xml`);
const assetsLayout = path.join(layoutDir, `assets`);
const appLayout = path.join(layoutDir, `app`);
const priConfig = path.join(layoutDir, 'priconfig.xml');
const priFile = path.join(layoutDir, 'resources.pri');
const createPri = options.createPri !== undefined ? options.createPri : true;
const createPri = options.createPri ?? true;
const createPriConfig = !options.priConfig;
const priConfigPath = options.priConfig ?? path.join(layoutDir, 'priconfig.xml');
const publisher = options.manifestVariables?.publisher || manifestPublisher || '';
const sign = options.sign !== undefined ? options.sign : true;
let windowsSignOptions: WindowsSignOptions
Expand Down Expand Up @@ -272,9 +273,10 @@ export const makeProgramOptions = async (options: PackagingOptions, manifestVars
cert_pfx,
cert_cer,
cert_pass: cert_pass || '',
priConfig,
priFile,
createPri,
createPriConfig,
priConfigPath,
isSparsePackage,
sign,
windowsSignOptions,
Expand Down