Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds a hook before MSICreator.create() is called #623

Merged
merged 2 commits into from
Nov 17, 2018
Merged
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
6 changes: 6 additions & 0 deletions packages/maker/wix/src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { MSICreator } from 'electron-wix-msi/lib/creator';

export interface MakerWixConfig {
/**
* String to set as appUserModelId on the shortcut. If none is passed, it'll
Expand Down Expand Up @@ -68,6 +70,10 @@ export interface MakerWixConfig {
* The password to decrypt the certificate given in `certificateFile`.
*/
certificatePassword?: string;
/**
* Allows for the modification of the MSICreator before create is called.
*/
beforeCreate?: (creator: MSICreator) => Promise<void> | void;
}
export interface UIOptions {
/**
Expand Down
3 changes: 3 additions & 0 deletions packages/maker/wix/src/MakerWix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export default class MakerWix extends MakerBase<MakerWixConfig> {
outputDirectory: outPath,
}) as MSICreatorOptions);

if (this.config.beforeCreate) {
await Promise.resolve(this.config.beforeCreate(creator));
}
await creator.create();
const { msiFile } = await creator.compile();

Expand Down