Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
b3cffcbb
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b3cffcbb
编写于
9月 14, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
energy command-line tools: windows package 7z, 7za
上级
c62d78a8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
10 deletion
+15
-10
cmd/internal/assets/assets/energy_linux.json
cmd/internal/assets/assets/energy_linux.json
+2
-1
cmd/internal/assets/assets/energy_windows.json
cmd/internal/assets/assets/energy_windows.json
+2
-1
cmd/internal/assets/assets/packager/windows/installer-tools.nsh
...ternal/assets/assets/packager/windows/installer-tools.nsh
+2
-2
cmd/internal/packager/pkg_nsis_windows.go
cmd/internal/packager/pkg_nsis_windows.go
+7
-5
cmd/internal/project/project.go
cmd/internal/project/project.go
+2
-1
未找到文件。
cmd/internal/assets/assets/energy_linux.json
浏览文件 @
b3cffcbb
...
...
@@ -16,7 +16,8 @@
"exclude"
:
[
"cache"
],
"package"
:
"com.{{.CompanyName}}.{{.CompanyName}}"
,
"homepage"
:
"https://github.com/energye/energy"
,
"compress"
:
"7zz"
"compress"
:
"7zz"
,
"compressName"
:
"framework.7z"
},
"author"
:
{
"name"
:
"yanghy"
,
...
...
cmd/internal/assets/assets/energy_windows.json
浏览文件 @
b3cffcbb
...
...
@@ -22,7 +22,8 @@
"license"
:
""
,
"language"
:
"english"
,
"requestExecutionLevel"
:
"admin"
,
"compress"
:
"7za"
"compress"
:
"7za"
,
"compressName"
:
"framework.7z"
},
"author"
:
{
"name"
:
"yanghy"
,
...
...
cmd/internal/assets/assets/packager/windows/installer-tools.nsh
浏览文件 @
b3cffcbb
...
...
@@ -45,8 +45,8 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}" ; admin or ""
!macro energy.compressNsis7z
{{if .NSIS.UseCompress}} ;CEF
Nsis7z::ExtractWithCallback "$INSTDIR\
CEF.7z
"
Delete "$OUTDIR\
CEF.7z
"
Nsis7z::ExtractWithCallback "$INSTDIR\
{{.NSIS.CompressName}}
"
Delete "$OUTDIR\
{{.NSIS.CompressName}}
"
{{end}}
!macroend
...
...
cmd/internal/packager/pkg_nsis_windows.go
浏览文件 @
b3cffcbb
...
...
@@ -72,14 +72,13 @@ func GeneraInstaller(proj *project.Project) error {
}
func
compressCEF7za
(
proj
*
project
.
Project
)
(
string
,
error
)
{
cef7zFile
:=
"CEF.7z"
term
.
Logger
.
Info
(
"7za compress "
+
cef7zFile
+
", This may take some time"
)
term
.
Logger
.
Info
(
"7za compress "
+
proj
.
NSIS
.
CompressName
+
", This may take some time"
)
buildWindowsPath
:=
filepath
.
Join
(
assets
.
BuildOutPath
(
proj
),
"windows"
)
outFilePath
:=
filepath
.
FromSlash
(
filepath
.
Join
(
buildWindowsPath
,
cef7zFil
e
))
outFilePath
:=
filepath
.
FromSlash
(
filepath
.
Join
(
buildWindowsPath
,
proj
.
NSIS
.
CompressNam
e
))
if
proj
.
Clean
{
os
.
Remove
(
outFilePath
)
}
else
if
tools
.
IsExist
(
outFilePath
)
{
term
.
Logger
.
Info
(
cef7zFil
e
+
" file exist"
)
term
.
Logger
.
Info
(
proj
.
NSIS
.
CompressNam
e
+
" file exist"
)
return
outFilePath
,
nil
}
...
...
@@ -98,7 +97,10 @@ func compressCEF7za(proj *project.Project) (string, error) {
cmd
:=
command
.
NewCMD
()
cmd
.
IsPrint
=
false
var
args
=
[]
string
{
"a"
,
outFilePath
,
filepath
.
FromSlash
(
fmt
.
Sprintf
(
"%s/*"
,
proj
.
FrameworkPath
))}
cmd
.
Command
(
"7za"
,
args
...
)
for
_
,
exc
:=
range
proj
.
NSIS
.
Exclude
{
args
=
append
(
args
,
"-xr!"
+
exc
)
}
cmd
.
Command
(
proj
.
NSIS
.
Compress
,
args
...
)
cmd
.
Close
()
return
outFilePath
,
nil
}
...
...
cmd/internal/project/project.go
浏览文件 @
b3cffcbb
...
...
@@ -132,7 +132,8 @@ type NSIS struct {
License
string
`json:"license"`
//安装包授权信息,(license.txt)文件路径
Language
string
`json:"language"`
//安装包语言, 中文: SimpChinese, 英文: English, 语言在 NSIS_HOME/Contrib/Language files
RequestExecutionLevel
string
`json:"requestExecutionLevel"`
//admin or ""
Compress
string
`json:"compress"`
//压纹CEF, 当前仅支持7z/a压缩,""(空)时不启用压缩 默认: 7za
Compress
string
`json:"compress"`
//压缩CEF, 当前仅支持7z/a压缩,""(空)时不启用压缩 默认: 7za
CompressName
string
`json:"compressName"`
//压缩CEF后的7z包名称
UseCompress
bool
`json:"-"`
//如果支持配置的, true=使用压缩
CompressFile
string
`json:"-"`
//压缩后的文件完全目录
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录