Skip to content

Commit

Permalink
fix: pass win properties correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
WankkoRee committed Jul 26, 2024
1 parent 7c73903 commit d7b6055
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 33 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ This object defines additional properties used for building for a specific platf
| ---- | ------- | --------- | ----------- |
| `icon` | `string` | `undefined` | The path to the icon file. It should be a .ico file. |
| `name` | `string` | Value of `name` in app's `package.json` | The name of the application |
| `version` | `string` | Value of `version` in app's `package.json` | The version of the application |
| `comments` | `string` | `undefined` | Additional information that should be displayed for diagnostic purposes. |
| `company` | `string` | `undefined` | Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. |
| `fileDescription` | `string` | Value of `description` in app's `package.json` | File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required. |
Expand Down
19 changes: 9 additions & 10 deletions src/bld.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import util from "./util.js";
*
* @typedef {object} WinRc Windows configuration options. More info
* @property {string} name The name of the application
* @property {string} version The version of the application
* @property {string} comments Additional information that should be displayed for diagnostic purposes.
* @property {string} company Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required.
* @property {string} fileDescription File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required.
Expand Down Expand Up @@ -295,17 +294,17 @@ const setLinuxConfig = async ({ app, outDir }) => {
const setWinConfig = async ({ app, outDir }) => {
let versionString = {
Comments: app.comments,
CompanyName: app.author,
CompanyName: app.company,
FileDescription: app.fileDescription,
FileVersion: app.fileVersion,
InternalName: app.name,
InternalName: app.internalName,
LegalCopyright: app.legalCopyright,
LegalTrademarks: app.legalTrademark,
OriginalFilename: app.name,
PrivateBuild: app.name,
ProductName: app.name,
ProductVersion: app.version,
SpecialBuild: app.name,
OriginalFilename: app.originalFilename,
PrivateBuild: app.privateBuild,
ProductName: app.productName,
ProductVersion: app.productVersion,
SpecialBuild: app.specialBuild,
};

Object.keys(versionString).forEach((option) => {
Expand All @@ -332,8 +331,8 @@ const setWinConfig = async ({ app, outDir }) => {
);
}
const [vi] = resedit.Resource.VersionInfo.fromEntries(res.entries);
const [major, minor, patch] = app.version.split(".");
vi.setFileVersion(major, minor, patch, 0, EN_US);
const [major, minor, micro, revision] = app.fileVersion.split(".");
vi.setFileVersion(major, minor, micro, revision, EN_US);
vi.setStringValues({
lang: EN_US,
codepage: 1200
Expand Down
40 changes: 19 additions & 21 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type AppOptions<P extends SupportedPlatform> =
: (WindowsAppOptions | OsxAppOptions | LinuxAppOptions);

/** Windows configuration options
*
*
* References:
* - https://learn.microsoft.com/en-us/windows/win32/msi/version
* - https://learn.microsoft.com/en-gb/windows/win32/sbscs/application-manifests
Expand All @@ -60,8 +60,6 @@ export interface WindowsAppOptions {
/** The name of the application */
name?: string,
/** The version of the application */
version?: string,
/** Additional information that should be displayed for diagnostic purposes. */
comments?: string,
/** Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required. */
company: string,
Expand Down Expand Up @@ -90,25 +88,25 @@ export interface WindowsAppOptions {
}

/** Linux configuration options
*
*
* References:
* https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
*/
export interface LinuxAppOptions {
/** Name of the application */
name?: string,
name?: string,
/** Generic name of the application */
genericName?: string,
genericName?: string,
/** If true the application is not displayed */
noDisplay?: boolean,
noDisplay?: boolean,
/** Tooltip for the entry, for example "View sites on the Internet". */
comment?: string,
comment?: string,
/** Icon to display in file manager, menus, etc. */
icon?: string,
icon?: string,
/** A list of strings identifying the desktop environments that should (/not) display a given desktop entry */
onlyShowIn?: string[],
onlyShowIn?: string[],
/** A list of strings identifying the desktop environments that should (/not) display a given desktop entry */
notShowIn?: string[],
notShowIn?: string[],
/** A boolean value specifying if D-Bus activation is supported for this application */
dBusActivatable?: boolean,
/** Path to an executable file on disk used to determine if the program is actually installed */
Expand Down Expand Up @@ -140,31 +138,31 @@ export interface LinuxAppOptions {
}

/** OSX resource configuration options
*
*
* References:
* https://developer.apple.com/documentation/bundleresources/information_property_list
*/
export interface OsxAppOptions {
/** The name of the application */
name?: string,
/** The path to the icon file. It should be a .icns file. */
icon?: string,
icon?: string,
/** The category that best describes your app for the App Store. */
LSApplicationCategoryType?: string,
LSApplicationCategoryType?: string,
/** A unique identifier for a bundle usually in reverse DNS format. */
CFBundleIdentifier?: string,
CFBundleIdentifier?: string,
/** A user-visible short name for the bundle. */
CFBundleName?: string,
CFBundleName?: string,
/** The user-visible name for the bundle. */
CFBundleDisplayName?: string,
CFBundleDisplayName?: string,
/** A replacement for the app name in text-to-speech operations. */
CFBundleSpokenName?: string,
CFBundleSpokenName?: string,
/** The version of the build that identifies an iteration of the bundle. */
CFBundleVersion?: string,
CFBundleVersion?: string,
/** The release or version number of the bundle. */
CFBundleShortVersionString?: string,
CFBundleShortVersionString?: string,
/** A human-readable copyright notice for the bundle. */
NSHumanReadableCopyright?: string,
NSHumanReadableCopyright?: string,
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ export const parse = async (options, pkg) => {
}
if (options.platform === "win") {
// windows configuration options
options.app.version = options.app.version ?? pkg.version;
options.app.comments = options.app.comments ?? undefined;
options.app.company = options.app.company ?? pkg.author;
options.app.fileDescription =
Expand Down

0 comments on commit d7b6055

Please sign in to comment.