Commit e35fcdb3 authored by rocosen's avatar rocosen

“first”

parent 7ecd153a
......@@ -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: {
......
......@@ -24,7 +24,7 @@ module.exports = {
typescript: {},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
'@typescript-eslint/parser': [],
},
},
};
!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}
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "开机自动启动"
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
......@@ -221,10 +221,19 @@
}
]
},
"nsis": {
"include": "build/eee.nsh",
"oneClick":false,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"createDesktopShortcut": "always"
},
"win": {
"target": [
"nsis"
]
],
"requestedExecutionLevel": "requireAdministrator"
},
"linux": {
"target": [
......@@ -260,4 +269,4 @@
],
"logLevel": "quiet"
}
}
}
\ No newline at end of file
......@@ -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';
const { shell } = require('electron')
const Hello = () => {
return (
......@@ -22,18 +24,14 @@ const Hello = () => {
Read our docs
</button>
</a>
<a
href="https://github.com/sponsors/electron-react-boilerplate"
target="_blank"
rel="noreferrer"
>
<button type="button">
<button type="button" onClick={()=>{
shell.openPath("D:\iii.bat");
}} >
<span role="img" aria-label="books">
🙏
</span>
Donate
</button>
</a>
</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