Skip to content

Commit

Permalink
Changing app name + version up
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Feb 18, 2023
1 parent b7a8d33 commit 6e26d47
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ labels:
body:
- type: markdown
attributes:
value: Please make sure to [search for existing issues](https://github.com/mienaiyami/react-ts-offline-manga-reader/issues) before filing a new one!
value: Please make sure to [search for existing issues](https://github.com/mienaiyami/yomikiru/issues) before filing a new one!

- type: textarea
attributes:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Manga Reader
# Yomikiru

Offline Manga/Manhwa Reader (not a downloader) built with react and typescript. Manga Reader for people who prefer to download manga/manhwa(from services like hakuneko) then read offline.

[![Github Latest Release](https://img.shields.io/github/v/tag/mienaiyami/react-ts-offline-manga-reader?label=release&style=flat-square&logo=github)](https://github.com/mienaiyami/react-ts-offline-manga-reader/releases/latest) |
[![Github All Releases](https://img.shields.io/github/downloads/mienaiyami/react-ts-offline-manga-reader/total.svg?style=flat-square&logo=github)](https://github.com/mienaiyami/react-ts-offline-manga-reader/releases)
[![Github Latest Release](https://img.shields.io/github/v/tag/mienaiyami/yomikiru?label=release&style=flat-square&logo=github)](https://github.com/mienaiyami/yomikiru/releases/latest) |
[![Github All Releases](https://img.shields.io/github/downloads/mienaiyami/yomikiru/total.svg?style=flat-square&logo=github)](https://github.com/mienaiyami/yomikiru/releases)

## Features

Expand Down
34 changes: 12 additions & 22 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@

## Downloads

[![Download setup](https://img.shields.io/badge/Windows%20Setup%20(exe)-$$EXE_NAME_1$$-brightgreen?logo=windows&logoColor=blue)](https://github.com/mienaiyami/react-ts-offline-manga-reader/releases/download/v$$TAG$$/$$EXE_NAME$$)
[![Download setup](https://img.shields.io/badge/Windows%20Setup%20(exe)-$$EXE_NAME_1$$-brightgreen?logo=windows&logoColor=blue)](https://github.com/mienaiyami/yomikiru/releases/download/v$$TAG$$/$$EXE_NAME$$)

[![Download Portable](https://img.shields.io/badge/Windows%20Portable%20(zip)-$$ZIP_NAME_1$$-brightgreen?logo=windows&logoColor=blue)](https://github.com/mienaiyami/react-ts-offline-manga-reader/releases/download/v$$TAG$$/$$ZIP_NAME$$)
[![Download Portable](https://img.shields.io/badge/Windows%20Portable%20(zip)-$$ZIP_NAME_1$$-brightgreen?logo=windows&logoColor=blue)](https://github.com/mienaiyami/yomikiru/releases/download/v$$TAG$$/$$ZIP_NAME$$)

---
## Note

## Added
App name will be changing to "Yomikiru".

- Open app automatically after updating (portable version).
- New shortcuts to switch between `PagePerRow` and `ReaderType`.
- Set max width of images (works only when `Size Clamp` is disabled).
- Search bar:
- Paste link in search bar to open.
- Type `..\` to go up directory.
- Type name of item in results ending with `\` to open it in reader. e.g. `One Piece\`.
- Type drive name ending with `:\` to change drive. e.g. `D:\`.
- Save toggled state of bookmark / history tab.
## Added

- Added canvas as image option to make stutter-free reader. Enable from settings.
- New reading mode "Right to Left".

## Changed

- Better searching system.
- Prevent some shortcuts if key pressed is held/repeated.
- Disable chapter transition screen in zen mode as well.
- Images in reader are now un-draggable.
- Scroll to current page number after changing `PagePerRow` and `ReaderType`.
- Removed checking for `.bin` file.
- Prevent some shortcuts from working if pressed in combination with `ctrl` key.
- UI enhancements.
- Less stutter when scrolling in normal image mode.
- UI Enhancements.

## Fixed

- App appear frozen when opening `.zip` or `.cbz` file.
- prev/next chapter not working when folder contain zip/cbz.
- Linking not working in theme maker.

---

#### Todo

- Add canvas based image system for performance.
- Add ability to change image quality in canvas mode for less RAM usage and performance.
- Write testing.
- Adjust app for debian.

Expand Down
118 changes: 87 additions & 31 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if (IS_PORTABLE) {
}
app.setPath("userData", folderPath);
}

// disabling hardware acceleration because it causes reader to stutter when scrolling
app.disableHardwareAcceleration();

Expand All @@ -37,52 +38,52 @@ const addOptionToExplorerMenu = () => {
const regInit = `Windows Registry Editor Version 5.00
; Setup context menu item for click on folders tree item:
[HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\MangaReader\\command]
[HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\Yomikiru\\command]
@="\\"${appPath}\\" \\"%V\\""
; Optional: specify an icon for the item:
[HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\MangaReader]
@="Open in Manga Reader"
[HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\Yomikiru]
@="Open in Yomikiru "
"icon"="${appPath}"
[HKEY_CLASSES_ROOT\\.cbz\\shell\\MangaReader]
@="Open in Manga Reader"
[HKEY_CLASSES_ROOT\\.cbz\\shell\\Yomikiru]
@="Open in Yomikiru"
"Icon"="${appPath}"
[HKEY_CLASSES_ROOT\\.cbz\\shell\\MangaReader\\command]
[HKEY_CLASSES_ROOT\\.cbz\\shell\\Yomikiru\\command]
@="\\"${appPath}\\" \\"%V\\""
[HKEY_CLASSES_ROOT\\MangaReader]
@="Manga Reader"
[HKEY_CLASSES_ROOT\\Yomikiru]
@="Yomikiru"
[HKEY_CLASSES_ROOT\\MangaReader\\DefaultIcon]
[HKEY_CLASSES_ROOT\\Yomikiru\\DefaultIcon]
@="${appPath}"
[HKEY_CLASSES_ROOT\\MangaReader\\shell\\open]
[HKEY_CLASSES_ROOT\\Yomikiru\\shell\\open]
"Icon"="${appPath}"
[HKEY_CLASSES_ROOT\\MangaReader\\shell\\open\\command]
[HKEY_CLASSES_ROOT\\Yomikiru\\shell\\open\\command]
@="\\"${appPath}\\" \\"%V\\""
[HKEY_CLASSES_ROOT\\.zip\\OpenWithProgids]
"MangaReader"=""
"Yomikiru"=""
`;

const tempPath = app.getPath("temp");
fs.writeFileSync(path.join(tempPath, "createOpenWithMangaReader.reg"), regInit);
fs.writeFileSync(path.join(tempPath, "createOpenWithYomikiru.reg"), regInit);

const op = {
name: "MangaReader",
name: "Yomikiru",
icns: app.getPath("exe"),
};
sudo.exec("regedit.exe /S " + path.join(tempPath, "createOpenWithMangaReader.reg"), op, function (error) {
sudo.exec("regedit.exe /S " + path.join(tempPath, "createOpenWithYomikiru.reg"), op, function (error) {
if (error) log.error(error);
});
};
// registry, remove option "open in reader" in explorer context menu
const deleteOptionInExplorerMenu = () => {
const deleteOldOptionInExplorerMenu = () => {
const regDelete = `Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\MangaReader]
Expand All @@ -107,6 +108,31 @@ const deleteOptionInExplorerMenu = () => {
}
);
};
const deleteOptionInExplorerMenu = () => {
const regDelete = `Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\\Software\\Classes\\directory\\shell\\Yomikiru]
[-HKEY_CLASSES_ROOT\\.cbz\\shell\\Yomikiru]
[-HKEY_CLASSES_ROOT\\Yomikiru]
[HKEY_CLASSES_ROOT\\.zip\\OpenWithProgids]
"Yomikiru"=-
`;
fs.writeFileSync(path.join(app.getPath("temp"), "deleteOpenWithYomikiru.reg"), regDelete);
const op = {
name: "Yomikiru",
icns: app.getPath("exe"),
};
sudo.exec(
"regedit.exe /S " + path.join(app.getPath("temp"), "deleteOpenWithYomikiru.reg"),
op,
function (error) {
if (error) log.error(error);
}
);
};

const handleSquirrelEvent = () => {
if (process.argv.length === 1) {
Expand All @@ -131,42 +157,38 @@ const handleSquirrelEvent = () => {
const vbsScript = `
Set WshShell = CreateObject("Wscript.shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oMyShortcut = WshShell.CreateShortcut(strDesktop + "\\Manga Reader.lnk")
Set oMyShortcut = WshShell.CreateShortcut(strDesktop + "\\Yomikiru.lnk")
oMyShortcut.WindowStyle = "1"
oMyShortcut.IconLocation = "${path.resolve(rootFolder, "app.ico")}"
OMyShortcut.TargetPath = "${appPath}"
oMyShortCut.Save
strStartMenu = WshShell.SpecialFolders("StartMenu")
Set oMyShortcut2 = WshShell.CreateShortcut(strStartMenu + "\\programs\\Manga Reader.lnk")
Set oMyShortcut2 = WshShell.CreateShortcut(strStartMenu + "\\programs\\Yomikiru.lnk")
oMyShortcut2.WindowStyle = "1"
oMyShortcut2.IconLocation = "${path.resolve(rootFolder, "app.ico")}"
OMyShortcut2.TargetPath = "${appPath}"
oMyShortCut2.Save
`;
fs.writeFileSync(path.resolve(rootFolder, "shortcut.vbs"), vbsScript);
spawnSync("cscript.exe", [path.resolve(rootFolder, "shortcut.vbs")]);
fs.unlinkSync(path.resolve(rootFolder, "shortcut.vbs"));

// fs.unlinkSync(path.resolve(rootFolder, "shortcut.vbs"));
app.quit();
break;

case "--squirrel-uninstall":
if (
fs.existsSync(
path.resolve(
homedir(),
"AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Manga Reader.lnk"
)
path.resolve(homedir(), "AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Yomikiru.lnk")
)
)
fs.unlinkSync(
path.resolve(
homedir(),
"AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Manga Reader.lnk"
)
path.resolve(homedir(), "AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Yomikiru.lnk")
);
deleteOldOptionInExplorerMenu();
deleteOptionInExplorerMenu();
if (fs.existsSync(path.resolve(homedir(), "Desktop/Manga Reader.lnk")))
fs.unlinkSync(path.resolve(homedir(), "Desktop/Manga Reader.lnk"));
if (fs.existsSync(path.resolve(homedir(), "Desktop/Yomikiru.lnk")))
fs.unlinkSync(path.resolve(homedir(), "Desktop/Yomikiru.lnk"));
const uninstallFull = `
set WshShell = CreateObject("Wscript.shell")
WScript.Sleep 30000
Expand Down Expand Up @@ -197,6 +219,37 @@ const handleSquirrelEvent = () => {
if (handleSquirrelEvent()) {
app.quit();
}

if (!IS_PORTABLE) {
if (!fs.existsSync(path.join(app.getPath("userData"), "settings.json"))) {
const oldAppPath = path.join(app.getPath("userData"), "../Manga Reader/");
if (fs.existsSync(oldAppPath)) {
log.log("Old app found, coping settings files.");
const filesToCopy = [
"bookmarks.json",
"history.json",
"settings.json",
"themes.json",
"shortcuts.json",
"logs/main.log",
"logs/renderer.log",
];
filesToCopy.forEach((e) => {
if (fs.existsSync(path.join(oldAppPath, e))) {
fs.copyFileSync(path.join(oldAppPath, e), path.join(app.getPath("userData"), e));
log.log(`${e} copied from ${path.join(oldAppPath, e)}`);
} else {
log.log(`${e} not found in ${oldAppPath}`);
}
});
log.log("Uninstalling old app...");
const oldUpdaterPath = path.join(app.getPath("userData"), "../../local/mangareader/Update.exe");
spawnSync(oldUpdaterPath, ["--uninstall"]);
log.log("Uninstall complete.");
}
}
}

// when manga reader opened from context menu "open with manga reader"
let openFolderOnLaunch = "";
if (app.isPackaged && process.argv[1] && fs.existsSync(process.argv[1])) {
Expand Down Expand Up @@ -299,6 +352,9 @@ const registerListener = () => {
ipcMain.on("deleteOptionInExplorerMenu", () => {
deleteOptionInExplorerMenu();
});
ipcMain.on("deleteOldOptionInExplorerMenu", () => {
deleteOldOptionInExplorerMenu();
});
ipcMain.on("canCheckForUpdate_response", (e, res, windowId, skipMinor) => {
if (res) checkForUpdate(windowId, skipMinor);
});
Expand All @@ -318,7 +374,7 @@ const registerListener = () => {
if (ask) {
const res = dialog.showMessageBoxSync(window, {
message: "Close this window?",
title: "Manga Reader",
title: "Yomikiru",
buttons: ["No", "Yes"],
type: "question",
});
Expand Down Expand Up @@ -378,7 +434,7 @@ app.on("ready", () => {
{
role: "help",
accelerator: "F1",
click: () => shell.openExternal("https://github.com/mienaiyami/react-ts-offline-manga-reader"),
click: () => shell.openExternal("https://github.com/mienaiyami/yomikiru"),
},
{
label: "New Window",
Expand Down
16 changes: 8 additions & 8 deletions electron/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const fileToKeep = [
"renderer.log",
];

const downloadLink = "https://github.com/mienaiyami/react-ts-offline-manga-reader/releases/download/v";
const downloadLink = "https://github.com/mienaiyami/yomikiru/releases/download/v";
/**
*
* @param windowId id of window in which message box should be shown
* @param promptAfterCheck (false by default) Show message box if current version is same as latest version.
*/
const checkForUpdate = async (windowId: number, skipMinor = false, promptAfterCheck = false) => {
const rawdata = await fetch(
"https://raw.githubusercontent.com/mienaiyami/react-ts-offline-manga-reader/master/package.json"
).then((data) => data.json());
const rawdata = await fetch("https://raw.githubusercontent.com/mienaiyami/yomikiru/master/package.json").then(
(data) => data.json()
);
const latestVersion: number[] = await rawdata.version.split(".").map((e: string) => parseInt(e));
logger.log("checking for update...");
const currentAppVersion = app
Expand Down Expand Up @@ -70,7 +70,7 @@ const checkForUpdate = async (windowId: number, skipMinor = false, promptAfterCh
if (response.response === 0) downloadUpdates(latestVersion.join("."), windowId);
if (response.response === 1) {
downloadUpdates(latestVersion.join("."), windowId);
// shell.openExternal("https://github.com/mienaiyami/react-ts-offline-manga-reader/releases");
// shell.openExternal("https://github.com/mienaiyami/yomikiru/releases");

const newWindow = new BrowserWindow({
width: 1200,
Expand All @@ -79,7 +79,7 @@ const checkForUpdate = async (windowId: number, skipMinor = false, promptAfterCh
minHeight: 560,
backgroundColor: "#272727",
});
newWindow.loadURL("https://github.com/mienaiyami/react-ts-offline-manga-reader/releases");
newWindow.loadURL("https://github.com/mienaiyami/yomikiru/releases");
newWindow.setMenuBarVisibility(false);
}
if (response.response === 2) {
Expand All @@ -90,7 +90,7 @@ const checkForUpdate = async (windowId: number, skipMinor = false, promptAfterCh
minHeight: 560,
backgroundColor: "#272727",
});
newWindow.loadURL("https://github.com/mienaiyami/react-ts-offline-manga-reader/releases");
newWindow.loadURL("https://github.com/mienaiyami/yomikiru/releases");
newWindow.setMenuBarVisibility(false);
}
});
Expand All @@ -100,7 +100,7 @@ const checkForUpdate = async (windowId: number, skipMinor = false, promptAfterCh
if (promptAfterCheck) {
dialog.showMessageBox(BrowserWindow.fromId(windowId ?? 1)!, {
type: "info",
title: "Manga Reader",
title: "Yomikiru",
message: "Running latest version",
buttons: [],
});
Expand Down
6 changes: 3 additions & 3 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
packagerConfig: {
name: "Manga Reader",
name: "Yomikiru",
},
plugins: [{
name: "@electron-forge/plugin-webpack",
Expand All @@ -20,8 +20,8 @@ module.exports = {
makers: [{
name: "@electron-forge/maker-squirrel",
config: {
// name: "mangareader",
// exe: "Manga Reader.exe",
// name: "Yomikiru",
// exe: "Yomikiru.exe",
// setupExe: `${packageJSON.name}_${packageJSON.version}_windows-setup.exe`,
},
},
Expand Down
Loading

0 comments on commit 6e26d47

Please sign in to comment.