feat(ruffle): add alternative ruffle flash target runner

This commit is contained in:
2026-05-15 21:55:38 +03:00
parent 715f6807d8
commit ca61b68cd9
8 changed files with 115 additions and 12 deletions

View File

@@ -5,15 +5,18 @@ const os = require('os');
const through = require('through2');
const Sdk = require('./sdk');
const System = require('./system');
const Env = require('./env');
const run = require('../run/index');
const {TailVinyl} = require('./tail');
class FlashPlayer extends Sdk {
BASE_URL = 'https://fpdownload.macromedia.com/pub/flashplayer/updaters';
constructor(debug, version) {
super(FlashPlayer.ID, version || FlashPlayer.VERSION);
constructor(debug, version, playerId = FlashPlayer.ID) {
super(playerId, version || FlashPlayer.VERSION);
this.debug = debug;
this.baseUrl = Env.get('FLASHPLAYER_URL') || this.BASE_URL;
}
prepare() {
@@ -29,22 +32,22 @@ class FlashPlayer extends Sdk {
}
get link() {
const baseUrl = `https://fpdownload.macromedia.com/pub/flashplayer/updaters/${this.version}/`;
const baseUrl = `${this.baseUrl}/${this.version}`;
if (System.isWindows) {
return baseUrl + `flashplayer_${this.version}_sa${this.debug ? '_debug' : ''}.exe`;
return this.baseUrl + `/flashplayer_${this.version}_sa${this.debug ? '_debug' : ''}.exe`;
} else if (System.isLinux) {
return baseUrl + `flash_player_sa_linux${this.debug ? '_debug' : ''}.x86_64.tar.gz`;
return this.baseUrl + `/flash_player_sa_linux${this.debug ? '_debug' : ''}.x86_64.tar.gz`;
} else {
throw `Unsupported os '${os.type()}'`;
}
}
get flashPlayerBin() {
if (os.type() === 'Windows_NT') {
if (System.isWindows) {
const v = this.version.split('.');
const playerName = `flashplayer_${this.version}_sa${this.debug ? '_debug' : ''}.exe`;
return path.join(this.path, playerName);
} else if (os.type() === 'Linux') {
} else if (System.isLinux) {
const binPath = path.join(this.path, `flashplayer${this.debug ? 'debugger' : ''}`);
fs.chmodSync(binPath, 0o755);
return binPath;