-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,102 additions
and
827 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
@echo off | ||
chcp 65001 >nul | ||
|
||
if "%~1"=="" goto :EOF | ||
if "%~2"=="" goto :EOF | ||
if "%~3"=="" goto :EOF | ||
|
||
set "SOURCE_A=%~1" | ||
set "TARGET_C=%~2" | ||
set "EXECUTABLE_NAME=%~3" | ||
|
||
:: Wait for a specific process to end | ||
echo Waiting for process %EXECUTABLE_NAME% to end... | ||
:WAIT_PROCESS | ||
set "PROCESS_NAME=%EXECUTABLE_NAME%" | ||
tasklist | find /i "%PROCESS_NAME%" >nul | ||
if not errorlevel 1 ( | ||
timeout /t 1 >nul | ||
goto :WAIT_PROCESS | ||
) | ||
|
||
echo Process %EXECUTABLE_NAME% has ended. | ||
|
||
:: Get directory B (the parent directory of C) | ||
echo Getting the parent directory of target %TARGET_C%... | ||
for %%I in ("%TARGET_C%") do ( | ||
set "DEST_B=%%~dpI" | ||
) | ||
|
||
:: Remove trailing backslash | ||
set "DEST_B=%DEST_B:~0,-1%" | ||
|
||
:: Check if source directory A exists, if not, exit | ||
echo Checking if source directory %SOURCE_A% exists... | ||
if not exist "%SOURCE_A%" goto :EOF | ||
|
||
echo Source directory %SOURCE_A% exists. | ||
|
||
:: Copy directory A to B | ||
echo Copying directory %SOURCE_A% to %DEST_B%\A... | ||
xcopy /E /I /Y "%SOURCE_A%" "%DEST_B%\A" >nul | ||
|
||
echo Copy completed. | ||
|
||
:: Delete target directory C (if it exists) | ||
echo Deleting target directory %TARGET_C% (if it exists)... | ||
if exist "%TARGET_C%" ( | ||
rd /S /Q "%TARGET_C%" | ||
echo Target directory %TARGET_C% has been deleted. | ||
) | ||
|
||
:: Rename directory A in B to C | ||
echo Renaming %DEST_B%\A to %~nx2... | ||
rename "%DEST_B%\A" "%~nx2" | ||
echo Rename completed. | ||
|
||
:: Delete original directory A | ||
echo Deleting original directory %SOURCE_A%... | ||
rd /S /Q "%SOURCE_A%" | ||
echo Original directory %SOURCE_A% has been deleted. | ||
|
||
:: Change to new C directory | ||
echo Changing to new target directory %TARGET_C%... | ||
pushd "%TARGET_C%" | ||
|
||
:: Start executable without waiting for it to finish | ||
echo Starting executable %EXECUTABLE_NAME%... | ||
start "" "%EXECUTABLE_NAME%" | ||
echo Executable has been started. | ||
|
||
:: Return to previous directory | ||
echo Returning to the previous directory... | ||
popd | ||
|
||
:: Delete the script itself | ||
echo Deleting the script itself... | ||
del /f /q "%~f0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'reflect-metadata' | ||
|
||
import { electronApp } from '@electron-toolkit/utils' | ||
import { AKARI_USER_MODEL_ID } from '@shared/constants/common' | ||
import { formatError } from '@shared/utils/errors' | ||
import { app, dialog } from 'electron' | ||
import { configure } from 'mobx' | ||
import EventEmitter from 'node:events' | ||
|
||
import { bootstrap } from './bootstrap' | ||
import { setupLeagueAkariModules } from './modules' | ||
import { appModule } from './modules/app' | ||
import { logModule } from './modules/log' | ||
import { mainWindowModule } from './modules/main-window' | ||
|
||
// EventEmitter.defaultMaxListeners = 1000 | ||
|
||
// configure({ enforceActions: 'observed' }) | ||
|
||
// const logger = logModule.createLogger('init') | ||
|
||
// const gotTheLock = app.requestSingleInstanceLock() | ||
|
||
// if (!gotTheLock) { | ||
// logger.info(`League Akari 已启动,将退出当前实例`) | ||
// app.quit() | ||
// } | ||
|
||
// appModule.registerAkariProtocolAsPrivileged() | ||
|
||
// const baseConfig = appModule.readBaseConfig() | ||
// if ( | ||
// baseConfig && | ||
// baseConfig.disableHardwareAcceleration && | ||
// baseConfig.disableHardwareAcceleration === true | ||
// ) { | ||
// logger.info('禁用硬件加速') | ||
// app.disableHardwareAcceleration() | ||
// } | ||
|
||
// app.whenReady().then(async () => { | ||
// electronApp.setAppUserModelId(AKARI_USER_MODEL_ID) | ||
// appModule.state.setReady(true) | ||
|
||
// try { | ||
// logger.info(`League Akari ${app.getVersion()}`) | ||
// await setupLeagueAkariModules() | ||
// mainWindowModule.createWindow() | ||
// } catch (e) { | ||
// logger.error(`初始化时出现错误 ${formatError(e)}`) | ||
// dialog.showErrorBox('在初始化时出现错误', e && (e as any).message) | ||
// app.quit() | ||
// } | ||
// }) | ||
|
||
// 新的启动方式 | ||
bootstrap() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,5 @@ | ||
import 'reflect-metadata' | ||
|
||
import { electronApp } from '@electron-toolkit/utils' | ||
import { AKARI_USER_MODEL_ID } from '@shared/constants/common' | ||
import { formatError } from '@shared/utils/errors' | ||
import { app, dialog } from 'electron' | ||
import { configure } from 'mobx' | ||
import EventEmitter from 'node:events' | ||
|
||
import { setupLeagueAkariModules } from './modules' | ||
import { appModule } from './modules/app' | ||
import { logModule } from './modules/log' | ||
import { mainWindowModule } from './modules/main-window' | ||
import { bootstrap } from './bootstrap' | ||
|
||
EventEmitter.defaultMaxListeners = 1000 | ||
|
||
configure({ enforceActions: 'observed' }) | ||
|
||
const logger = logModule.createLogger('init') | ||
|
||
const gotTheLock = app.requestSingleInstanceLock() | ||
|
||
if (!gotTheLock) { | ||
logger.info(`League Akari 已启动,将退出当前实例`) | ||
app.quit() | ||
} | ||
|
||
appModule.registerAkariProtocolAsPrivileged() | ||
|
||
const baseConfig = appModule.readBaseConfig() | ||
if ( | ||
baseConfig && | ||
baseConfig.disableHardwareAcceleration && | ||
baseConfig.disableHardwareAcceleration === true | ||
) { | ||
logger.info('禁用硬件加速') | ||
app.disableHardwareAcceleration() | ||
} | ||
|
||
app.whenReady().then(async () => { | ||
electronApp.setAppUserModelId(AKARI_USER_MODEL_ID) | ||
appModule.state.setReady(true) | ||
|
||
try { | ||
logger.info(`League Akari ${app.getVersion()}`) | ||
await setupLeagueAkariModules() | ||
mainWindowModule.createWindow() | ||
} catch (e) { | ||
logger.error(`初始化时出现错误 ${formatError(e)}`) | ||
dialog.showErrorBox('在初始化时出现错误', e && (e as any).message) | ||
app.quit() | ||
} | ||
}) | ||
|
||
// 新的启动方式 | ||
// bootstrap() | ||
bootstrap() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.