Commit 1610acc3 authored by rocosen's avatar rocosen

Merge branch 'feat-test-bat' into 'master'

Feat test bat

See merge request !1
parents 7ecd153a efc8bc56
......@@ -23,8 +23,7 @@ const configuration: webpack.Configuration = {
target: 'electron-main',
entry: {
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'),
main: path.join(webpackPaths.srcMainPath, 'main.ts')
},
output: {
......
......@@ -43,7 +43,7 @@ const configuration: webpack.Configuration = {
mode: 'development',
target: ['web', 'electron-renderer'],
target: 'electron-renderer',
entry: [
`webpack-dev-server/client?http://localhost:${port}/dist`,
......@@ -54,10 +54,7 @@ const configuration: webpack.Configuration = {
output: {
path: webpackPaths.distRendererPath,
publicPath: '/',
filename: 'renderer.dev.js',
library: {
type: 'umd',
},
filename: 'renderer.dev.js'
},
module: {
......
......@@ -23,17 +23,14 @@ const configuration: webpack.Configuration = {
mode: 'production',
target: ['web', 'electron-renderer'],
target: 'electron-renderer',
entry: [path.join(webpackPaths.srcRendererPath, 'index.tsx')],
output: {
path: webpackPaths.distRendererPath,
publicPath: './',
filename: 'renderer.js',
library: {
type: 'umd',
},
filename: 'renderer.js'
},
module: {
......
......@@ -31,3 +31,5 @@ npm-debug.log.*
# eslint ignores hidden directories by default:
# https://github.com/eslint/eslint/issues/8429
!.erb
src/
\ No newline at end of file
......@@ -4,7 +4,7 @@
".prettierrc": "jsonc",
".eslintignore": "ignore"
},
"eslint.validate": [
"javascript",
"javascriptreact",
......@@ -15,7 +15,6 @@
"javascript.validate.enable": false,
"javascript.format.enable": false,
"typescript.format.enable": false,
"search.exclude": {
".git": true,
".eslintcache": true,
......
22
\ No newline at end of file
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
chcp 65001
sc config LanmanServer start= disabled
echo N | net stop LanmanServer
sc config iphlpsvc start= auto
start "" /w /B "%cd%\resources\assets\exe\devcon.exe" /install %windir%\inf\netloop.inf *msloop
powershell -Command "$interfaces = Get-WmiObject Win32_NetworkAdapter;$interfaces | foreach {$friendlyname = $_ | Select-Object -ExpandProperty NetConnectionID;$name = $_ | Select-Object -ExpandProperty Name;$friendlyname | Out-File -Encoding utf8 aa.txt;}
set /p netname=<aa.txt
echo %netname%
netsh interface ip add address "%netname%" 1.10.0.1 255.255.255.0
netsh interface ip add address "%netname%" 1.10.1.1 255.255.255.0
netsh interface portproxy add v4tov4 listenport=445 listenaddress=1.10.0.1 connectaddress=47.93.217.126 connectport=4555
netsh interface portproxy add v4tov4 listenport=445 listenaddress=1.10.1.1 connectaddress=180.76.134.227 connectport=4555
md C:\test
mklink /D c:\test\aliyun \\1.10.0.1\ali\1b520eb8a56147299ad803f9f87b6297
mklink /D c:\test\baiduyun \\1.10.1.1\data\1b520eb8a56147299ad803f9f87b6297
\ No newline at end of file
@echo off
net use \\1.10.0.1\ali\1b520eb8a56147299ad803f9f87b6297 123456 /user:cloudam /persistent:yes
net use \\1.10.1.1\data\1b520eb8a56147299ad803f9f87b6297 123456 /user:cloudam /persistent:yes
subst Z: C:\test
\ No newline at end of file
currentpath = createobject("Scripting.FileSystemObject").GetFolder(".").Path
path = Chr(34) & currentpath & "\mount.bat" & Chr(34)
Set shell=CreateObject("WScript.Shell")
a = shell.run (path,0)
Set wshell = Nothing
!include nsDialogs.nsh
XPStyle on
Var Dialog
Page custom myCustomPage
Function myCustomPage
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "开机自动启动"
SetRebootFlag true
IfRebootFlag 0 +2
FunctionEnd
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
!macroend
!macro customInstall
nsExec::Exec "D:\ooo.bat"
!macroend
!macro customUnInstall
DeleteRegKey HKCR "cloudam"
!macroend
\ No newline at end of file
!include nsDialogs.nsh
XPStyle on
Var Dialog
Page custom myCustomPage
Function myCustomPage
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
SetRebootFlag true
IfRebootFlag 0 +2
FunctionEnd
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\test-e"
!macroend
!macro customInstall
nsExec::Exec "$INSTDIR\resources\assets\script\init.bat"
!macroend
!macro customUnInstall
DeleteRegKey HKCR "cloudam"
!macroend
\ No newline at end of file
......@@ -108,8 +108,12 @@
}
},
"dependencies": {
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mui/material": "^5.10.8",
"electron-debug": "^3.2.0",
"electron-log": "^4.4.8",
"electron-root-path": "^1.1.0",
"electron-updater": "^5.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
......@@ -183,8 +187,8 @@
"webpack-merge": "^5.8.0"
},
"build": {
"productName": "ElectronReact",
"appId": "org.erb.ElectronReact",
"productName": "bkunyun",
"appId": "org.erb.bkunyun",
"asar": true,
"asarUnpack": "**\\*.{node,dll}",
"files": [
......@@ -221,6 +225,14 @@
}
]
},
"nsis": {
"include": "build/installer.nsh",
"oneClick": false,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"createDesktopShortcut": "always"
},
"win": {
"target": [
"nsis"
......
{
"name": "electron-react-boilerplate",
"version": "4.6.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "electron-react-boilerplate",
"version": "4.6.0",
"hasInstallScript": true,
"license": "MIT"
}
}
"lockfileVersion": 1
}
{
"name": "electron-react-boilerplate",
"version": "4.6.0",
"description": "A foundation for scalable desktop apps",
"name": "bkunyun",
"version": "0.0.1",
"description": "北鲲云盘",
"license": "MIT",
"author": {
"name": "Electron React Boilerplate Maintainers",
......@@ -14,5 +14,7 @@
"postinstall": "npm run electron-rebuild && npm run link-modules",
"link-modules": "node -r ts-node/register ../../.erb/scripts/link-modules.ts"
},
"dependencies": {}
"dependencies": {
"install": "^0.13.0"
}
}
......@@ -76,9 +76,8 @@ const createWindow = async () => {
icon: getAssetPath('icon.png'),
webPreferences: {
sandbox: false,
preload: app.isPackaged
? path.join(__dirname, 'preload.js')
: path.join(__dirname, '../../.erb/dll/preload.js'),
nodeIntegration: true,
contextIsolation: false,
},
});
......
import { MemoryRouter as Router, Routes, Route } from 'react-router-dom';
import icon from '../../assets/icon.svg';
import './App.css';
import path from 'path';
import { Button } from '@mui/material';
const rootPath = require('electron-root-path').rootPath;
const { shell } = require('electron');
const location = path.join(
rootPath.substring(0, rootPath.length - 8),
'./assets/script/start.vbs'
);
const Hello = () => {
return (
<div>
<div className="Hello">
<img width="200" alt="icon" src={icon} />
</div>
<h1>electron-react-boilerplate</h1>
<h1>electron-react</h1>
<div className="Hello">
<a
href="https://electron-react-boilerplate.js.org/"
target="_blank"
rel="noreferrer"
>
<button type="button">
<span role="img" aria-label="books">
📚
</span>
Read our docs
</button>
</a>
<a
href="https://github.com/sponsors/electron-react-boilerplate"
target="_blank"
rel="noreferrer"
<Button
variant="contained"
onClick={() => {
shell.openPath(location);
}}
>
<button type="button">
<span role="img" aria-label="books">
🙏
</span>
Donate
</button>
</a>
挂载
</Button>
</div>
</div>
);
......
......@@ -6,8 +6,8 @@ const root = createRoot(container);
root.render(<App />);
// calling IPC exposed from preload script
window.electron.ipcRenderer.once('ipc-example', (arg) => {
// eslint-disable-next-line no-console
console.log(arg);
});
window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);
// window.electron.ipcRenderer.once('ipc-example', (arg) => {
// // eslint-disable-next-line no-console
// console.log(arg);
// });
// window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment