Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fbc3ebef46 | |||
| ede11165a9 | |||
| bdb1033958 | |||
| 78411c9fa4 | |||
| 47aba5bb36 | |||
| da495a9b39 | |||
| c30866e58e | |||
| 6c1ffff0e0 | |||
| e3c6d96785 | |||
| 57ad789c61 | |||
| 47863bb45e | |||
| 9c98bf1eb8 | |||
| 6df468db4d | |||
| 5320b29eed | |||
| d5688df03f | |||
| e121c457af | |||
| 45d061f051 | |||
| d9a0353091 | |||
| 9622100513 | |||
| 55b97251a0 | |||
| 576200b489 | |||
| da7c0b1513 | |||
| f2d8191b0d | |||
| 3bd800d296 | |||
| 5e9570023b | |||
| 64d8f4a382 | |||
| de601111f9 | |||
| 5c83088633 | |||
| c73331bf6a | |||
| 9a1bbd40fb | |||
| 1861b3b818 | |||
| 99c4e2e31c | |||
| ec32c63b29 | |||
| 09f4a9a3ed | |||
| d86d40f90d | |||
| 7e32d63415 | |||
| 13f8d8bd7b | |||
| 473033ba7b | |||
| 5a4e6e6b37 | |||
| 3aae0c143c | |||
| e5c008887b | |||
| 9cd62be64d |
+2
-1
@@ -1 +1,2 @@
|
||||
* text eol=lf
|
||||
text eol=lf
|
||||
rom -text
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -3,7 +3,7 @@ name: Build & Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
# - master
|
||||
- master
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 15.x
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
@@ -63,6 +63,7 @@ jobs:
|
||||
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
|
||||
- name: Set Windows signing certificate
|
||||
if: matrix.os == 'windows-latest'
|
||||
continue-on-error: true
|
||||
id: write_file
|
||||
uses: timheuer/base64-to-file@v1
|
||||
with:
|
||||
@@ -82,18 +83,12 @@ jobs:
|
||||
run: yarn
|
||||
- name: Make
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: yarn make
|
||||
run: yarn make --arch=all
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
|
||||
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
|
||||
- name: Make (ia32)
|
||||
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/')
|
||||
run: yarn make -- --arch=ia32
|
||||
env:
|
||||
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
|
||||
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
|
||||
# - name: Archive production artifacts
|
||||
# uses: actions/upload-artifact@v2
|
||||
# with:
|
||||
@@ -105,6 +100,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
out/**/*.deb
|
||||
out/**/*.dmg
|
||||
|
||||
@@ -6,10 +6,104 @@ This is Mac OS 8, running in an [Electron](https://electronjs.org/) app pretendi
|
||||
|
||||
## Downloads
|
||||
|
||||
| | Windows | macOS | Linux |
|
||||
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Standalone Download | 📦[Standalone, 32-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintosh.js-win32-ia32-1.0.2.zip) <br /> 📦[Standalone, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintosh.js-win32-x64-1.0.2.zip) | 📦[Standalone](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintosh.js-darwin-x64-1.0.2.zip) | |
|
||||
| Installer | 💽[Setup, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintoshjs-1.0.2-setup-x64.exe) <br /> 💽[Setup, 32-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintoshjs-1.0.2-setup-ia32.exe) | | 💽[deb, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintosh.js_1.0.2_amd64.deb) <br /> 💽[rpm, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.2/macintosh.js-1.0.2-1.x86_64.rpm) |
|
||||
<table class="is-fullwidth">
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./.github/images/windows.png" width="24"><br />
|
||||
Windows
|
||||
</td>
|
||||
<td>
|
||||
<span>32-bit</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintoshjs-1.1.0-setup-ia32.exe">
|
||||
💿 Installer
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-win32-ia32-1.1.0.zip">
|
||||
📦 Standalone Zip
|
||||
</a>
|
||||
<br />
|
||||
<span>64-bit</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintoshjs-1.1.0-setup-x64.exe">
|
||||
💿 Installer
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-win32-ia32-1.1.0.zip">
|
||||
📦 Standalone Zip
|
||||
</a><br />
|
||||
<span>ARM64</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintoshjs-1.1.0-setup-arm64.exe">
|
||||
💿 Installer
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-win32-ia32-1.1.0.zip">
|
||||
📦 Standalone Zip
|
||||
</a><br />
|
||||
<span>
|
||||
❓ Don't know what kind of chip you have? Hit start, enter "processor" for info.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./.github/images/macos.png" width="24"><br />
|
||||
macOS
|
||||
</td>
|
||||
<td>
|
||||
<span>Intel Processor</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-darwin-x64-1.1.0.zip">
|
||||
📦 Standalone Zip
|
||||
</a><br />
|
||||
<span>Apple M1 Processor</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-darwin-arm64-1.1.0.zip">
|
||||
📦 Standalone Zip
|
||||
</a><br />
|
||||
<span>
|
||||
❓ Don't know what kind of chip you have? Learn more at <a href="https://support.apple.com/en-us/HT211814">apple.com</a>.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./.github/images/linux.png" width="24"><br />
|
||||
Linux
|
||||
</td>
|
||||
<td>
|
||||
<span>32-bit</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-1.1.0-1.i386.rpm">
|
||||
💿 rpm
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js_1.1.0_i386.deb">
|
||||
💿 deb
|
||||
</a><br />
|
||||
<span>64-bit</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-1.1.0-1.x86_64.rpm">
|
||||
💿 rpm
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js_1.1.0_amd64.deb">
|
||||
💿 deb
|
||||
</a><br />
|
||||
<span>ARM64</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-1.1.0-1.arm64.rpm">
|
||||
💿 rpm
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js_1.1.0_arm64.deb">
|
||||
💿 deb
|
||||
</a><br />
|
||||
<span>ARMv7 (armhf)</span>
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js-1.1.0-1.arm64.rpm">
|
||||
💿 rpm
|
||||
</a> |
|
||||
<a href="https://github.com/felixrieseberg/macintosh.js/releases/download/v1.1.0/macintosh.js_1.1.0_armhf.deb">
|
||||
💿 deb
|
||||
</a><br />
|
||||
<span>
|
||||
❓ Don't know what kind of chip you have? Run `uname -m` in the console.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr />
|
||||
|
||||
## Does it work?
|
||||
Yes! Quite well, actually - on macOS, Windows, and Linux. Bear in mind that this is written entirely in JavaScript, so please adjust your expectations. The virtual machine is emulating a 1991 Macintosh Quadra 900 with a Motorola CPU, which Apple used before switching to the PowerPC architecture (Apple/IBM/Motorola) in the mid 1990s.
|
||||
@@ -36,7 +130,7 @@ Probably not. This is a toy - it's not the best nor the most performant way to e
|
||||
|
||||
## Credits
|
||||
|
||||
Please check out the [CREDITS](CREDITS.md)! This app wouldn't be possible with the hard work of [Christian Bauer](https://www.cebix.net/) and [James Friend](https://jamesfriend.com.au/), who did everything that seems like computing magic here.
|
||||
Please check out the [CREDITS](CREDITS.md)! This app wouldn't be possible without the hard work of [Christian Bauer](https://www.cebix.net/) and [James Friend](https://jamesfriend.com.au/), who did everything that seems like computing magic here.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+9
-1
@@ -75,7 +75,15 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-deb',
|
||||
platforms: ['linux']
|
||||
platforms: ['linux'],
|
||||
options: {
|
||||
maintainer: 'Felix Rieseberg',
|
||||
homepage: 'https://github.com/felixrieseberg/macintosh.js',
|
||||
categories: [
|
||||
'Education',
|
||||
],
|
||||
icon: path.resolve(__dirname, 'assets', 'icon.png')
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-rpm',
|
||||
|
||||
+12
-10
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "macintosh.js",
|
||||
"productName": "macintosh.js",
|
||||
"version": "1.0.3",
|
||||
"version": "1.1.0",
|
||||
"description": "Macintosh's System 8 in an Electron app. I'm sorry.",
|
||||
"main": "src/main/index.js",
|
||||
"scripts": {
|
||||
@@ -9,8 +9,9 @@
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make",
|
||||
"publish": "electron-forge publish",
|
||||
"lint": "npx prettier --check src/{main,renderer}/*.{js,css}",
|
||||
"fix": "npx prettier --write src/{main,renderer}/*.{js,css}"
|
||||
"lint": "npx prettier --check src/{main,renderer}/*.{js,css} && npm run check-links",
|
||||
"fix": "npx prettier --write src/{main,renderer}/*.{js,css}",
|
||||
"check-links": "node tools/check-links.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": {
|
||||
@@ -23,14 +24,15 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"update-electron-app": "^1.5.0"
|
||||
"update-electron-app": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "6.0.0-beta.52",
|
||||
"@electron-forge/maker-deb": "6.0.0-beta.52",
|
||||
"@electron-forge/maker-rpm": "6.0.0-beta.52",
|
||||
"@electron-forge/maker-squirrel": "6.0.0-beta.52",
|
||||
"@electron-forge/maker-zip": "6.0.0-beta.52",
|
||||
"electron": "10.0.0-beta.12"
|
||||
"@electron-forge/cli": "6.0.0-beta.54",
|
||||
"@electron-forge/maker-deb": "6.0.0-beta.54",
|
||||
"@electron-forge/maker-rpm": "6.0.0-beta.54",
|
||||
"@electron-forge/maker-squirrel": "6.0.0-beta.54",
|
||||
"@electron-forge/maker-zip": "6.0.0-beta.54",
|
||||
"electron": "11.1.1",
|
||||
"node-fetch": "^2.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { error } = require("console");
|
||||
|
||||
const homeDir = require("os").homedir();
|
||||
const macDir = path.join(homeDir, "macintosh.js");
|
||||
@@ -13,6 +12,24 @@ function getUserDataDiskPath() {
|
||||
return path.join(userDataPath, "disk");
|
||||
}
|
||||
|
||||
// File type utilities
|
||||
|
||||
function isFile(v = "") {
|
||||
return fs.statSync(path.join(macDir, v)).isFile();
|
||||
}
|
||||
|
||||
function isHiddenFile(filename = '') {
|
||||
return filename.startsWith('.');
|
||||
}
|
||||
|
||||
function isCDImage(filename = '') {
|
||||
return filename.endsWith('.iso') || filename.endsWith('.toast');
|
||||
}
|
||||
|
||||
function isDiskImage(filename = '') {
|
||||
return filename.endsWith('.img') || filename.endsWith('.dsk') || filename.endsWith('.hda');
|
||||
}
|
||||
|
||||
function cleanupCopyPath() {
|
||||
try {
|
||||
if (fs.existsSync(macintoshCopyPath)) {
|
||||
@@ -36,7 +53,12 @@ function getUserDataDiskImage() {
|
||||
|
||||
// If there's a disk image, move it over
|
||||
if (!fs.existsSync(diskImageUserPath)) {
|
||||
fs.renameSync(diskImagePath, diskImageUserPath);
|
||||
try {
|
||||
fs.renameSync(diskImagePath, diskImageUserPath);
|
||||
} catch (error) {
|
||||
// This is _probably_ a permissions thing, let's copy the file
|
||||
fs.copyFileSync(diskImagePath, diskImageUserPath);
|
||||
}
|
||||
} else {
|
||||
console.log(
|
||||
`getUserDataDiskImage: Image in user data dir, not doing anything`
|
||||
@@ -55,7 +77,7 @@ function preloadFilesAtPath(module, initalSourcePath) {
|
||||
}`;
|
||||
const files = fs.readdirSync(sourcePath).filter((v) => {
|
||||
// Remove hidden, iso, and img files
|
||||
return !v.startsWith(".") && !v.endsWith(".iso") && !v.endsWith(".img");
|
||||
return !isHiddenFile(v) && !isDiskImage(v) && !isCDImage(v);
|
||||
});
|
||||
|
||||
(files || []).forEach((fileName) => {
|
||||
@@ -187,9 +209,9 @@ function writePrefs(userImages = []) {
|
||||
if (userImages && userImages.length > 0) {
|
||||
console.log(`writePrefs: Found ${userImages.length} user images`);
|
||||
userImages.forEach(({ name }) => {
|
||||
if (name.endsWith(".iso")) {
|
||||
if (isCDImage(name)) {
|
||||
prefs += `\ncdrom ${name}`;
|
||||
} else if (name.endsWith(".img")) {
|
||||
} else if (isDiskImage(name)) {
|
||||
prefs += `\ndisk ${name}`;
|
||||
}
|
||||
});
|
||||
@@ -203,14 +225,6 @@ function writePrefs(userImages = []) {
|
||||
}
|
||||
}
|
||||
|
||||
function isMacDirFileOfType(extension = "", v = "") {
|
||||
const isType = v.endsWith(`.${extension}`);
|
||||
const isMatch = isType && fs.statSync(path.join(macDir, v)).isFile();
|
||||
|
||||
console.log(`isMacDirFileOfType: ${v} is file and ${extension}: ${isMatch}`);
|
||||
return isMatch;
|
||||
}
|
||||
|
||||
function getUserImages() {
|
||||
const result = [];
|
||||
|
||||
@@ -222,8 +236,8 @@ function getUserImages() {
|
||||
}
|
||||
|
||||
const macDirFiles = fs.readdirSync(macDir);
|
||||
const imgFiles = macDirFiles.filter((v) => isMacDirFileOfType("img", v));
|
||||
const isoFiles = macDirFiles.filter((v) => isMacDirFileOfType("iso", v));
|
||||
const imgFiles = macDirFiles.filter((v) => isFile(v) && isDiskImage(v));
|
||||
const isoFiles = macDirFiles.filter((v) => isFile(v) && isCDImage(v));
|
||||
const isoImgFiles = [...isoFiles, ...imgFiles];
|
||||
|
||||
console.log(`getUserImages: iso and img files`, isoImgFiles);
|
||||
|
||||
@@ -43,8 +43,9 @@ function tryToSendInput() {
|
||||
switch (inputEvent.type) {
|
||||
case "mousemove":
|
||||
hasMouseMove = true;
|
||||
mouseMoveX += inputEvent.dx;
|
||||
mouseMoveY += inputEvent.dy;
|
||||
// Make change according to https://github.com/felixrieseberg/macintosh.js/issues/6#issuecomment-665981700
|
||||
mouseMoveX = inputEvent.dx;
|
||||
mouseMoveY = inputEvent.dy;
|
||||
break;
|
||||
case "mousedown":
|
||||
case "mouseup":
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
const fs = require('fs/promises')
|
||||
const path = require('path')
|
||||
const fetch = require('node-fetch')
|
||||
|
||||
const LINK_RGX = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/g;
|
||||
|
||||
async function main() {
|
||||
const readmePath = path.join(__dirname, '../README.md')
|
||||
const readme = await fs.readFile(readmePath, 'utf-8')
|
||||
const links = readme.match(LINK_RGX)
|
||||
let failed = false
|
||||
|
||||
for (const link of links) {
|
||||
try {
|
||||
const response = await fetch(link, { method: 'HEAD' })
|
||||
|
||||
if (!response.ok) {
|
||||
// If we're inside GitHub's release asset server, we just ran into AWS not allowing
|
||||
// HEAD requests, which is different from a 404.
|
||||
if (!response.url.startsWith('https://github-production-release-asset')) {
|
||||
throw new Error (`HTTP Error Response: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`✅ ${link}`);
|
||||
} catch (error) {
|
||||
failed = true
|
||||
|
||||
console.log(`❌ ${link}\n${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (failed) {
|
||||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user