Compare commits

...

7 Commits

Author SHA1 Message Date
Felix Rieseberg e8a227fa1d 1.0.1 2020-07-28 15:11:48 -07:00
Felix Rieseberg b6ee882c2b fix: Don't load hidden files 2020-07-28 15:08:07 -07:00
Felix Rieseberg e07027130d fix: Correct border radius for canvas 2020-07-28 15:02:00 -07:00
Felix Rieseberg 66fce5effd fix: One more link 2020-07-28 12:56:29 -07:00
Felix Rieseberg a9c133c19a Merge pull request #3 from metaphox/patch-1
fix x64 win32 standalone link
2020-07-28 12:54:49 -07:00
Tao Wu 2a4ce913d5 fix x64 win32 standalone link 2020-07-28 21:31:27 +02:00
Felix Rieseberg b9f25ebf34 fix: One of the download links 2020-07-28 10:46:29 -07:00
4 changed files with 76 additions and 65 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ This is Mac OS 8, running in an [Electron](https://electronjs.org/) app pretendi
| | Windows | macOS | Linux |
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Standalone Download | 📦[Standalone, 32-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-win32-x64-1.0.0.zip) <br /> 📦[Standalone, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-win32-ia32-1.0.0.zip) | 📦[Standalone](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-darwin-x64-1.0.0.zip) | |
| Standalone Download | 📦[Standalone, 32-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-win32-ia32-1.0.0.zip) <br /> 📦[Standalone, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-win32-x64-1.0.0.zip) | 📦[Standalone](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-darwin-x64-1.0.0.zip) | |
| Installer | 💽[Setup, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintoshjs-1.0.0-setup-x64.exe) <br /> 💽[Setup, 32-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintoshjs-1.0.0-setup-ia32.exe) | | 💽[deb, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js_1.0.0_amd64.deb) <br /> 💽[rpm, 64-bit](https://github.com/felixrieseberg/macintosh.js/releases/download/v1.0.0/macintosh.js-1.0.0-1.x86_64.rpm) |
## Does it work?
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "macintosh.js",
"productName": "macintosh.js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Macintosh's System 8 in an Electron app. I'm sorry.",
"main": "src/main/index.js",
"scripts": {
+67 -63
View File
@@ -48,76 +48,79 @@ function getUserDataDiskImage() {
}
}
function addAutoloader(module) {
const copyFilesAtPath = function (sourcePath) {
try {
const absoluteSourcePath = path.join(macDir, sourcePath);
const absoluteTargetPath = path.join(macintoshCopyPath, sourcePath);
const targetPath = `/macintosh.js${sourcePath ? `/${sourcePath}` : ""}`;
const files = fs.readdirSync(absoluteSourcePath).filter((v) => {
// Remove iso and img files
return !v.endsWith(".iso") && !v.endsWith(".img");
});
// Taken a given path, it'll look at all the files in there,
// copy them over to the basilisk folder, and then add them
// to MEMFS
function copyFilesAtPath(module, sourcePath) {
try {
const absoluteSourcePath = path.join(macDir, sourcePath);
const absoluteTargetPath = path.join(macintoshCopyPath, sourcePath);
const targetPath = `/macintosh.js${sourcePath ? `/${sourcePath}` : ""}`;
const files = fs.readdirSync(absoluteSourcePath).filter((v) => {
// Remove hidden, iso, and img files
return !v.startsWith('.') && !v.endsWith(".iso") && !v.endsWith(".img");
});
(files || []).forEach((fileName) => {
try {
// If not, let's move on
const fileSourcePath = path.join(absoluteSourcePath, fileName);
const copyPath = path.join(absoluteTargetPath, fileName);
const relativeSourcePath = `${
sourcePath ? `${sourcePath}/` : ""
}${fileName}`;
const fileUrl = `user_files/${relativeSourcePath}`;
(files || []).forEach((fileName) => {
try {
// If not, let's move on
const fileSourcePath = path.join(absoluteSourcePath, fileName);
const copyPath = path.join(absoluteTargetPath, fileName);
const relativeSourcePath = `${
sourcePath ? `${sourcePath}/` : ""
}${fileName}`;
const fileUrl = `user_files/${relativeSourcePath}`;
// Check if directory
if (fs.statSync(fileSourcePath).isDirectory()) {
if (!fs.existsSync(copyPath)) {
fs.mkdirSync(copyPath);
}
try {
const virtualDirPath = `${targetPath}/${fileName}`;
module.FS.mkdir(virtualDirPath);
} catch (error) {
console.log(error);
}
copyFilesAtPath(relativeSourcePath);
return;
// Check if directory
if (fs.statSync(fileSourcePath).isDirectory()) {
if (!fs.existsSync(copyPath)) {
fs.mkdirSync(copyPath);
}
// We copy the files over and then add them as preload
console.log(`loadDatafiles: Adding ${fileName}`);
fs.copyFileSync(fileSourcePath, copyPath);
try {
const virtualDirPath = `${targetPath}/${fileName}`;
module.FS.mkdir(virtualDirPath);
} catch (error) {
console.log(error);
}
module.FS_createPreloadedFile(
targetPath,
fileName,
fileUrl,
true,
true
);
} catch (error) {
postMessage("showMessageBoxSync", {
type: "error",
title: "Could not transfer file",
message: `We tried to transfer ${fileName} to the virtual machine, but failed. The error was: ${error}`,
});
console.error(`loadDatafiles: Failed to preload ${fileName}`, error);
copyFilesAtPath(module, relativeSourcePath);
return;
}
});
} catch (error) {
postMessage("showMessageBoxSync", {
type: "error",
title: "Could not transfer files",
message: `We tried to transfer files to the virtual machine, but failed. The error was: ${error}`,
});
console.error(`loadDatafiles: Failed to copyFilesAtPath`, error);
}
};
// We copy the files over and then add them as preload
console.log(`copyFilesAtPath: Adding ${fileName}`);
fs.copyFileSync(fileSourcePath, copyPath);
module.FS_createPreloadedFile(
targetPath,
fileName,
fileUrl,
true,
true
);
} catch (error) {
postMessage("showMessageBoxSync", {
type: "error",
title: "Could not transfer file",
message: `We tried to transfer ${fileName} to the virtual machine, but failed. The error was: ${error}`,
});
console.error(`copyFilesAtPath: Failed to preload ${fileName}`, error);
}
});
} catch (error) {
postMessage("showMessageBoxSync", {
type: "error",
title: "Could not transfer files",
message: `We tried to transfer files to the virtual machine, but failed. The error was: ${error}`,
});
console.error(`copyFilesAtPath: Failed to copyFilesAtPath`, error);
}
};
function addAutoloader(module) {
const loadDatafiles = function () {
module.autoloadFiles.forEach((filepath) => {
const parent = `/`;
@@ -134,7 +137,8 @@ function addAutoloader(module) {
return;
}
copyFilesAtPath("");
// Load user files
copyFilesAtPath(module, "");
};
if (module.autoloadFiles) {
+7
View File
@@ -10,6 +10,13 @@
cursor: none;
}
canvas {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
}
.controls {
text-align: center;
margin-top: 5px;