[tauri] InstallerName: Publish the Windows installer as RoseaDomi_<version>_x64-setup.exe, a name Aula and Atrium accept; productName stays Rosea Domi
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* The Windows installer's published file name. Tauri's NSIS bundler names it after `productName`
|
||||
* (`Rosea Domi_<version>_x64-setup.exe`), and the space keeps it off Aula: Aula makes an installer
|
||||
* public only when its name matches `[A-Za-z0-9._-]+-setup.exe` (Aula docs/14_feed.md), the
|
||||
* `<Name>_<version>_x64-setup.exe` form Atrium Domi expects as well.
|
||||
*
|
||||
* Only the file is renamed after the build. `productName` stays "Rosea Domi": it is also the window
|
||||
* title, the install folder and the uninstall entry Atrium finds her by, and changing it would make
|
||||
* the next installer a second app beside the first.
|
||||
*/
|
||||
import { PRODUCT_NAME } from '../../../packages/schema/src/constants.js';
|
||||
|
||||
/** What Aula and Atrium accept as an installer's name. */
|
||||
export const INSTALLER_PATTERN = /^[A-Za-z0-9._-]+-setup\.exe$/;
|
||||
|
||||
/** Tauri's own name for the installer of a version. */
|
||||
export const tauriInstallerName = (version: string): string => `${PRODUCT_NAME}_${version}_x64-setup.exe`;
|
||||
|
||||
/** The published name: the product name without spaces, e.g. `RoseaDomi_0.1.2_x64-setup.exe`. */
|
||||
export function installerName(version: string): string {
|
||||
if (!/^\d+\.\d+\.\d+$/.test(version)) throw new Error(`not a version: ${version}`);
|
||||
const name = `${PRODUCT_NAME.replace(/\s+/g, '')}_${version}_x64-setup.exe`;
|
||||
if (!INSTALLER_PATTERN.test(name)) throw new Error(`the installer's name would not be accepted: ${name}`);
|
||||
return name;
|
||||
}
|
||||
Reference in New Issue
Block a user