Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
netdisc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rocosen
netdisc
Commits
e35fcdb3
Commit
e35fcdb3
authored
Oct 09, 2022
by
rocosen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
“first”
parent
7ecd153a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
29 deletions
+88
-29
webpack.config.main.prod.ts
.erb/configs/webpack.config.main.prod.ts
+1
-2
webpack.config.renderer.dev.ts
.erb/configs/webpack.config.renderer.dev.ts
+2
-5
webpack.config.renderer.prod.ts
.erb/configs/webpack.config.renderer.prod.ts
+2
-5
.eslintrc.js
.eslintrc.js
+1
-1
eee.nsh
build/eee.nsh
+17
-0
installer.nsh
build/installer.nsh
+43
-0
package.json
package.json
+10
-1
main.ts
src/main/main.ts
+2
-3
App.tsx
src/renderer/App.tsx
+5
-7
index.tsx
src/renderer/index.tsx
+5
-5
No files found.
.erb/configs/webpack.config.main.prod.ts
View file @
e35fcdb3
...
@@ -23,8 +23,7 @@ const configuration: webpack.Configuration = {
...
@@ -23,8 +23,7 @@ const configuration: webpack.Configuration = {
target
:
'electron-main'
,
target
:
'electron-main'
,
entry
:
{
entry
:
{
main
:
path
.
join
(
webpackPaths
.
srcMainPath
,
'main.ts'
),
main
:
path
.
join
(
webpackPaths
.
srcMainPath
,
'main.ts'
)
preload
:
path
.
join
(
webpackPaths
.
srcMainPath
,
'preload.ts'
),
},
},
output
:
{
output
:
{
...
...
.erb/configs/webpack.config.renderer.dev.ts
View file @
e35fcdb3
...
@@ -43,7 +43,7 @@ const configuration: webpack.Configuration = {
...
@@ -43,7 +43,7 @@ const configuration: webpack.Configuration = {
mode
:
'development'
,
mode
:
'development'
,
target
:
[
'web'
,
'electron-renderer'
]
,
target
:
'electron-renderer'
,
entry
:
[
entry
:
[
`webpack-dev-server/client?http://localhost:
${
port
}
/dist`
,
`webpack-dev-server/client?http://localhost:
${
port
}
/dist`
,
...
@@ -54,10 +54,7 @@ const configuration: webpack.Configuration = {
...
@@ -54,10 +54,7 @@ const configuration: webpack.Configuration = {
output
:
{
output
:
{
path
:
webpackPaths
.
distRendererPath
,
path
:
webpackPaths
.
distRendererPath
,
publicPath
:
'/'
,
publicPath
:
'/'
,
filename
:
'renderer.dev.js'
,
filename
:
'renderer.dev.js'
library
:
{
type
:
'umd'
,
},
},
},
module
:
{
module
:
{
...
...
.erb/configs/webpack.config.renderer.prod.ts
View file @
e35fcdb3
...
@@ -23,17 +23,14 @@ const configuration: webpack.Configuration = {
...
@@ -23,17 +23,14 @@ const configuration: webpack.Configuration = {
mode
:
'production'
,
mode
:
'production'
,
target
:
[
'web'
,
'electron-renderer'
]
,
target
:
'electron-renderer'
,
entry
:
[
path
.
join
(
webpackPaths
.
srcRendererPath
,
'index.tsx'
)],
entry
:
[
path
.
join
(
webpackPaths
.
srcRendererPath
,
'index.tsx'
)],
output
:
{
output
:
{
path
:
webpackPaths
.
distRendererPath
,
path
:
webpackPaths
.
distRendererPath
,
publicPath
:
'./'
,
publicPath
:
'./'
,
filename
:
'renderer.js'
,
filename
:
'renderer.js'
library
:
{
type
:
'umd'
,
},
},
},
module
:
{
module
:
{
...
...
.eslintrc.js
View file @
e35fcdb3
...
@@ -24,7 +24,7 @@ module.exports = {
...
@@ -24,7 +24,7 @@ module.exports = {
typescript
:
{},
typescript
:
{},
},
},
'import/parsers'
:
{
'import/parsers'
:
{
'@typescript-eslint/parser'
:
[
'.ts'
,
'.tsx'
],
'@typescript-eslint/parser'
:
[],
},
},
},
},
};
};
build/eee.nsh
0 → 100644
View file @
e35fcdb3
!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
build/installer.nsh
0 → 100644
View file @
e35fcdb3
!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
package.json
View file @
e35fcdb3
...
@@ -221,10 +221,19 @@
...
@@ -221,10 +221,19 @@
}
}
]
]
},
},
"nsis"
:
{
"include"
:
"build/eee.nsh"
,
"oneClick"
:
false
,
"perMachine"
:
true
,
"allowElevation"
:
true
,
"allowToChangeInstallationDirectory"
:
true
,
"createDesktopShortcut"
:
"always"
},
"win"
:
{
"win"
:
{
"target"
:
[
"target"
:
[
"nsis"
"nsis"
]
],
"requestedExecutionLevel"
:
"requireAdministrator"
},
},
"linux"
:
{
"linux"
:
{
"target"
:
[
"target"
:
[
...
...
src/main/main.ts
View file @
e35fcdb3
...
@@ -76,9 +76,8 @@ const createWindow = async () => {
...
@@ -76,9 +76,8 @@ const createWindow = async () => {
icon
:
getAssetPath
(
'icon.png'
),
icon
:
getAssetPath
(
'icon.png'
),
webPreferences
:
{
webPreferences
:
{
sandbox
:
false
,
sandbox
:
false
,
preload
:
app
.
isPackaged
nodeIntegration
:
true
,
?
path
.
join
(
__dirname
,
'preload.js'
)
contextIsolation
:
false
,
:
path
.
join
(
__dirname
,
'../../.erb/dll/preload.js'
),
},
},
});
});
...
...
src/renderer/App.tsx
View file @
e35fcdb3
import
{
MemoryRouter
as
Router
,
Routes
,
Route
}
from
'react-router-dom'
;
import
{
MemoryRouter
as
Router
,
Routes
,
Route
}
from
'react-router-dom'
;
import
icon
from
'../../assets/icon.svg'
;
import
icon
from
'../../assets/icon.svg'
;
import
'./App.css'
;
import
'./App.css'
;
const
{
shell
}
=
require
(
'electron'
)
const
Hello
=
()
=>
{
const
Hello
=
()
=>
{
return
(
return
(
...
@@ -22,18 +24,14 @@ const Hello = () => {
...
@@ -22,18 +24,14 @@ const Hello = () => {
Read our docs
Read our docs
</
button
>
</
button
>
</
a
>
</
a
>
<
a
<
button
type=
"button"
onClick=
{
()
=>
{
href=
"https://github.com/sponsors/electron-react-boilerplate"
shell
.
openPath
(
"D:
\
iii.bat"
);
target=
"_blank"
}
}
>
rel=
"noreferrer"
>
<
button
type=
"button"
>
<
span
role=
"img"
aria
-
label=
"books"
>
<
span
role=
"img"
aria
-
label=
"books"
>
🙏
🙏
</
span
>
</
span
>
Donate
Donate
</
button
>
</
button
>
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/renderer/index.tsx
View file @
e35fcdb3
...
@@ -6,8 +6,8 @@ const root = createRoot(container);
...
@@ -6,8 +6,8 @@ const root = createRoot(container);
root
.
render
(<
App
/>);
root
.
render
(<
App
/>);
// calling IPC exposed from preload script
// calling IPC exposed from preload script
window
.
electron
.
ipcRenderer
.
once
(
'ipc-example'
,
(
arg
)
=>
{
//
window.electron.ipcRenderer.once('ipc-example', (arg) => {
// eslint-disable-next-line no-console
//
// eslint-disable-next-line no-console
console
.
log
(
arg
);
//
console.log(arg);
});
//
});
window
.
electron
.
ipcRenderer
.
sendMessage
(
'ipc-example'
,
[
'ping'
]);
//
window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment