@shockpkg/swf-projector
Package for creating Flash Player projectors
Last updated 13 days ago by jrmastermodelbuilder .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @shockpkg/swf-projector 
SYNC missed versions from official npm registry.

swf-projector

Package for creating Flash Player projectors

npm node

dependencies size downloads

travis-ci

Overview

Creates Flash projectors from a standalone Flash Player.

Takes a standalone Flash Player file, a directory containing a standalone Flash Player, or a shockpkg standalone Flash Player package file.

Can also create bundles that group the projector and resources in a directory beside a single launcher for Windows and Linux or within an application bundle for macOS.

Reading DMG projector packages is only supported on macOS.

Usage

Projector

Windows

import {ProjectorWindows32} from '@shockpkg/swf-projector';

const projector = new ProjectorWindows('projector-windows32/application.exe');

// Optional custom icon.
projector.iconFile = 'icon.ico';

// Optional custom PE resource strings.
projector.versionStrings = {
	FileVersion: '3.1.4',
	ProductVersion: '3.1.4',
	CompanyName: 'Custom Company Name',
	FileDescription: 'Custom File Description',
	LegalCopyright: 'Custom Legal Copyright',
	ProductName: 'Custom Product Name',
	LegalTrademarks: 'Custom Legal Trademarks',
	OriginalFilename: 'CustomOriginalFilename.exe',
	InternalName: 'CustomInternalName',
	Comments: 'Custom Comments'
};

// Optionally patch window title.
projector.patchWindowTitle = 'Custom Title';

// Optionally remove now-broken signature.
projector.removeCodeSignature = true;

await projector.withFile('player.exe', 'movie.swf');

Mac App

import {ProjectorMacApp} from '@shockpkg/swf-projector';

const projector = new ProjectorMacApp('projector-macapp/application.app');

// Optional custom icon.
projector.iconFile = 'icon.icns';

// Optionally change main binary name.
projector.binaryName = 'application';

// Optionally base Info.plist file.
projector.infoPlistFile = 'Info.plist';

// Optionally custom PkgInfo file.
projector.pkgInfoFile = 'PkgInfo';

// Optionally update bundle name.
projector.bundleName = 'application';

// Optionally remove file associations.
projector.removeFileAssociations = true;

// Optionally exclude InfoPlist.strings files.
projector.removeInfoPlistStrings = true;

// Optionally remove now-broken signature.
projector.removeCodeSignature = true;

await projector.withFile('player.dmg', 'movie.swf');

Linux 32-bit

import {ProjectorLinux32} from '@shockpkg/swf-projector';

const projector = new ProjectorLinux32('projector-linux32/application');

// Optionally patch window title.
projector.patchWindowTitle = 'Custom Title';

// Optionally disable menu entirely.
// projector.patchMenuRemove = true;

// Necessary to load from relative paths.
projector.patchProjectorPath = true;

await projector.withFile('player.tar.gz', 'movie.swf');

Linux 64-bit

import {ProjectorLinux64} from '@shockpkg/swf-projector';

const projector = new ProjectorLinux64('projector-linux64/application');

// Optionally patch window title.
projector.patchWindowTitle = 'Custom Title';

// Optionally disable menu entirely.
// projector.patchMenuRemove = true;

// Necessary to load from relative paths.
projector.patchProjectorPath = true;

// Necessary unless the binaries get fixed.
projector.patchProjectorOffset = true;

await projector.withFile('player.tar.gz', 'movie.swf');

Bundle

Windows

import {BundleWindows32} from '@shockpkg/swf-projector';

const bundle = new BundleWindows32('bundle-windows32/application.exe');

// Use projector property to set options.
bundle.projector.removeCodeSignature = true;

await bundle.withFile('player.exe', 'movie.swf', async b => {
	// Add resources in callback.
	await b.copyResource('other.swf', 'other.swf');
});

Mac App

import {BundleMacApp} from '@shockpkg/swf-projector';

const bundle = new BundleMacApp('bundle-macapp/application.app');

// Use projector property to set options.
bundle.projector.removeCodeSignature = true;

await bundle.withFile('player.dmg', 'movie.swf', async b => {
	// Add resources in callback.
	await b.copyResource('other.swf', 'other.swf');
});

Linux 32-bit

import {BundleLinux32} from '@shockpkg/swf-projector';

const bundle = new BundleLinux32('bundle-linux32/application');

// Use projector property to set options.
bundle.projector.patchProjectorPath = true;

await bundle.withFile('player.tar.gz', 'movie.swf', async b => {
	// Add resources in callback.
	await b.copyResource('other.swf', 'other.swf');
});

Linux 64-bit

import {BundleLinux64} from '@shockpkg/swf-projector';

const bundle = new BundleLinux64('bundle-linux64/application');

// Use projector property to set options.
bundle.projector.patchProjectorPath = true;
bundle.projector.patchProjectorOffset = true;

await bundle.withFile('player.tar.gz', 'movie.swf', async b => {
	// Add resources in callback.
	await b.copyResource('other.swf', 'other.swf');
});

Notes

Linux

Option: patchWindowTitle

An option to replace the window title stored in the binary. Size cannot be larger than the title being replaced in the binary.

Option: patchMenuRemove

An option to completely disable the menu for the projector. Avoids layout calculation issues when the menu is in the window.

Option: patchProjectorPath

Compatible with Flash Player 9+ (version 6 was correct).

Required since Flash Player 10.1+ to load relative paths (earlier versions would try the relative path first, before trying resolved path).

Projectors create the main URL with: "file:" + argv[0] resolving to a bad URL like file://file|%2Fpath%2Fto%2Fapplication causing relative paths to load from the root of the drive.

This patch replaces the string reference to use "file://" + argv[0] instead, which resolves to file:///path/to/application when run by an absolute path.

Not a perfect patch because it does not resolve the full path first, if run from relative path would get path like file://./application, but an improvement. Recommended to use a shell script or binary that resolves itself and runs projector from an absolute path. Using a Bundle does this automatically.

Option: patchProjectorOffset

The Linux projector reading code was never updated for 64-bit ELF compatibility. This patch fixes reading projector data in 64-bit Linux projectors.

Bugs

If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.

License

Copyright (c) 2019-2020 JrMasterModelBuilder

Licensed under the Mozilla Public License, v. 2.0.

If this license does not work for you, feel free to contact me.

Current Tags

  • 2.3.0                                ...           latest (13 days ago)

21 Versions

  • 2.3.0                                ...           13 days ago
  • 2.2.0                                ...           14 days ago
  • 2.1.0                                ...           19 days ago
  • 2.0.1                                ...           21 days ago
  • 2.0.0                                ...           21 days ago
  • 1.6.2                                ...           a month ago
  • 1.6.1                                ...           2 months ago
  • 1.6.0                                ...           2 months ago
  • 1.5.1                                ...           2 months ago
  • 1.5.0                                ...           5 months ago
  • 1.4.1                                ...           6 months ago
  • 1.4.0                                ...           6 months ago
  • 1.3.1                                ...           8 months ago
  • 1.3.0                                ...           9 months ago
  • 1.2.1                                ...           10 months ago
  • 1.2.0                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 76
Last Day 0
Last Week 0
Last Month 22
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |