Skip to content

Commit 957a775

Browse files
committed
Update
1 parent 38c95e6 commit 957a775

File tree

7 files changed

+775
-4
lines changed

7 files changed

+775
-4
lines changed

NSIS/LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

NSIS/bin/kj-cli.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
setlocal
3+
4+
set dir=%CD%
5+
chcp 65001 2>nul >nul
6+
7+
set java_exe=java.exe
8+
9+
if defined JAVA_HOME (
10+
set java_exe="%JAVA_HOME%\bin\java.exe"
11+
)
12+
13+
%java_exe% -jar -Duser.language=en -DpathFile=%dir% -DlibsPath="%KJ_HOME%\libs" -Dfile.encoding=UTF8 "%KJ_HOME%\bin\kj-cli.jar" %*
14+
15+
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" pause

NSIS/bin/kj-cli.jar

2.1 MB
Binary file not shown.

NSIS/setup.exe

1.94 MB
Binary file not shown.

NSIS/setup.nsi

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
;--------------------------------
2+
;Include Modern UI
3+
4+
!include "MUI2.nsh"
5+
6+
;--------------------------------
7+
;General
8+
9+
;Name and file
10+
Name "Executor CLI"
11+
OutFile "setup.exe"
12+
Unicode True
13+
14+
;Default installation folder
15+
InstallDir "$PROGRAMFILES\kj-cli"
16+
17+
;Request application privileges for Windows Vista
18+
RequestExecutionLevel admin
19+
20+
;--------------------------------
21+
;Interface Settings
22+
23+
!define MUI_ABORTWARNING
24+
25+
;--------------------------------
26+
;Pages
27+
28+
!insertmacro MUI_PAGE_LICENSE "LICENSE"
29+
!insertmacro MUI_PAGE_DIRECTORY
30+
!insertmacro MUI_PAGE_INSTFILES
31+
32+
!insertmacro MUI_UNPAGE_CONFIRM
33+
!insertmacro MUI_UNPAGE_INSTFILES
34+
35+
;--------------------------------
36+
;Languages
37+
38+
!insertmacro MUI_LANGUAGE "English"
39+
40+
;--------------------------------
41+
;Installer Sections
42+
43+
Section
44+
CreateDirectory "$INSTDIR"
45+
CreateDirectory "$INSTDIR\bin"
46+
47+
SetOutPath "$INSTDIR\bin"
48+
File bin\kj-cli.jar
49+
50+
SetOutPath "$WINDIR"
51+
File bin\kj-cli.bat
52+
53+
nsExec::Exec 'setx KJ_HOME "$INSTDIR" /m'
54+
WriteUninstaller "$INSTDIR\Uninstall.exe"
55+
56+
SectionEnd
57+
58+
;--------------------------------
59+
;Descriptions
60+
61+
;Language strings
62+
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
63+
64+
;Assign language strings to sections
65+
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
66+
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
67+
!insertmacro MUI_FUNCTION_DESCRIPTION_END
68+
69+
;--------------------------------
70+
;Uninstaller Section
71+
72+
Section "Uninstall"
73+
74+
Delete "$INSTDIR\Uninstall.exe"
75+
Delete "$INSTDIR\bin\kj-cli.jar"
76+
Delete "$WINDIR\kj-cli.bat"
77+
78+
RMDir "$INSTDIR\bin"
79+
RMDir "$INSTDIR"
80+
81+
DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
82+
83+
SectionEnd

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jar {
2727
dependencies {
2828
implementation group: 'commons-cli', name: 'commons-cli', version: '1.4'
2929
//implementation group: 'com.github.kayjamlang', name: 'core', version: '0.1.2.1'
30-
implementation group: 'com.github.kayjamlang', name: 'executor', version: '0.1.3.16'
30+
implementation group: 'com.github.kayjamlang', name: 'executor', version: '0.1.3.17-fix6'
3131
implementation group: 'com.github.albfernandez', name: 'juniversalchardet', version: '2.4.0'
3232
testCompile group: 'junit', name: 'junit', version: '4.13'
3333
}

src/main/java/com/github/kayjamlang/executor/cli/Main.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ public static void main(String[] args) throws Exception {
4141

4242
Executor executor = new Executor();
4343
executor.addLibrary(new MainLibrary());
44-
File libDir = new File(Paths.get(System.getProperty("user.dir"),
45-
"./libs/").normalize().toString());
46-
if(libDir.exists()||libDir.createNewFile()){
44+
File libDir = new File(System.getProperty("libsPath"));
45+
if(libDir.exists()||libDir.mkdir()){
4746
File[] files = libDir.listFiles();
4847
if(files!=null)
4948
for(File libJar: files){

0 commit comments

Comments
 (0)