Skip to content

Commit

Permalink
fix(maker-wix): inherit config types from electron-wix-msi (#3858)
Browse files Browse the repository at this point in the history
* fix(maker-wix): inherit config types from `electron-wix-msi`

* Add TSDoc back
  • Loading branch information
erickzhao authored Feb 19, 2025
1 parent 4571cb5 commit 64714a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 118 deletions.
135 changes: 18 additions & 117 deletions packages/maker/wix/src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,137 +1,38 @@
import { Features, MSICreator } from 'electron-wix-msi/lib/creator';
import { MSICreator, MSICreatorOptions } from 'electron-wix-msi/lib/creator';

export interface MakerWixConfig {
/**
* String to set as appUserModelId on the shortcut. If none is passed, it'll
* be set to com.squirrel.(Name).(exe), which should match the id given to
* your app by Squirrel.
*/
appUserModelId?: string;
/**
* A comma separated string of extensions with each to be associated the app icon.
*/
associateExtensions?: string;
export type MakerWixConfig = Omit<MSICreatorOptions, 'appDirectory' | 'outputDirectory' | 'description' | 'name' | 'version' | 'manufacturer' | 'exe'> & {
/**
* The app's description
*
* @defaultValue The `description` field in package.json
*/
description?: string;
/**
* The name of the exe file
*/
exe?: string;
/*
* The app's icon
*/
icon?: string;
/**
* The [Microsoft Windows Language Code identifier](https://msdn.microsoft.com/en-us/library/cc233965.aspx) used by the installer.
* Will use 1033 (English, United-States) if left undefined.
*/
language?: number;
/**
* The app's manufacturer
*/
manufacturer?: string;
/**
* The app's name
* The app's name.
*
* @defaultValue The value of `packagerConfig.name` in the Forge config, or the `productName` or `name` in package.json (in that order)
*/
name?: string;
/**
* Name of the folder your app will live in. Will use the app's `name` if left
* undefined.
*/
programFilesFolderName?: string;
/**
* A short name for the app, used wherever spaces and special characters are
* not allowed. Will use the `name` if left undefined.
*/
shortName?: string;
/**
* Name of the shortcut folder in the Windows Start Menu. Will use the
* `manufacturer` field if left undefined.
*/
shortcutFolderName?: string;
/**
* Enables configuration of the UI
*/
ui?: UIOptions | false;
/**
* A unique UUID used by your app to identify itself. This module will
* generate one for you, but it is important to reuse it to enable
* conflict-free upgrades.
*/
upgradeCode?: string;
/**
* The app's version. It must be a valid semantic version.
*
* @defaultValue The `version` field in package.json
*/
version?: string;
/**
* Parameters to pass to signtool.exe. Overrides `certificateFile` and
* `certificatePassword`.
*/
signWithParams?: string;
/**
* The path to an Authenticode Code Signing Certificate.
*/
certificateFile?: string;
/**
* The password to decrypt the certificate given in `certificateFile`.
* The app's manufacturer
*
* @defaultValue The `author` field in package.json
*/
certificatePassword?: string;
manufacturer?: string;
/**
* Enables configuration of the autoUpdate and autoLaunch features.
* By default, they are disabled.
* The name of the exe file
*
* @defaultValue the default {@link MakerWixConfig.name} + `.exe`
*/
features?: Features | false;
exe?: string;
/**
* Allows for the modification of the MSICreator before create is called.
*/
beforeCreate?: (creator: MSICreator) => Promise<void> | void;
}
export interface UIOptions {
/**
* If set to true, the end user will be able to choose the installation
* directory. Set to false by default. Without effect if a custom template is
* used.
*/
chooseDirectory?: boolean;
/**
* Substitute your own XML that will be inserted into the final .wxs file
* before compiling the installer to customize the UI options.
*/
template?: string;
/**
* Overwrites default installer images with custom files. I recommend JPG.
*/
images?: UIImages;
}
export interface UIImages {
/**
* 493 x 312 Background bitmap used on the welcome and completion dialogs.
* Will be used as WixUIDialogBmp
*/
background?: string;
/**
* 493 × 58 Top banner used on most dialogs that don't use background.
* Will be used as WixUIBannerBmp
*/
banner?: string;
/**
* 32 x 32 Exclamation icon on the WaitForCostingDlg dialog.
* Will be used as WixUIExclamationIco
*/
exclamationIcon?: string;
/**
* 32 x 32 Information icon on the cancel and error dialogs.
* Will be used as WixUIInfoIco
*/
infoIcon?: string;
/**
* 16 x 16 "New folder" icon for the "browse" dialog. Will be used as WixUINewIco
*/
newIcon?: string;
/**
* 16 x 16 "Up" icon for the "browse" dialog. Will be used as WixUIUpIco
*/
upIcon?: string;
}
};
2 changes: 1 addition & 1 deletion packages/maker/wix/src/MakerWix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class MakerWix extends MakerBase<MakerWixConfig> {
...this.config,
appDirectory: dir,
outputDirectory: outPath,
} as MSICreatorOptions);
});

if (this.config.beforeCreate) {
await Promise.resolve(this.config.beforeCreate(creator));
Expand Down

0 comments on commit 64714a4

Please sign in to comment.