I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7212f855 authored by zzz's avatar zzz
Browse files

Upgrade to launch4j 3.0.1 2008-07-20.

The license is BSD for launch4j and MIT for the wrapper code in head/

Changelog is in installer/lib/launch4j/web/changelog.html
Hopefully this will fix installs for 64-bit JRE on 64-bit windows.

The previous version was 2.0-RC3 2005-08-13.
The previous license was GPLv2 for launch4j and LGPLv2.1 for the wrapper code in head/

The bin/ld.exe and bin/windres.exe files were contributed by
i2p users in 2005 so the i2p installer could be built on windows.

They have not been updated for 3.0.1, so pkg builds on windows
will presumably still get 2.0-RC3.
parent d7e90969
No related branches found
No related tags found
No related merge requests found
Showing
with 1454 additions and 1372 deletions
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed.
...@@ -5,11 +5,11 @@ CPP = g++.exe ...@@ -5,11 +5,11 @@ CPP = g++.exe
CC = gcc.exe CC = gcc.exe
WINDRES = windres.exe WINDRES = windres.exe
RES = RES =
OBJ = consolehead.o ../head.o $(RES) OBJ = ../../head/consolehead.o ../../head/head.o $(RES)
LINKOBJ = consolehead.o ../head.o $(RES) LINKOBJ = ../../head/consolehead.o ../../head/head.o $(RES)
LIBS = -L"lib" -s LIBS = -L"C:/Dev-Cpp/lib" -n -s
INCS = -I"include" INCS = -I"C:/Dev-Cpp/include"
CXXINCS = -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
BIN = consolehead.exe BIN = consolehead.exe
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3 CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
CFLAGS = $(INCS) -fexpensive-optimizations -O3 CFLAGS = $(INCS) -fexpensive-optimizations -O3
...@@ -24,10 +24,10 @@ clean: clean-custom ...@@ -24,10 +24,10 @@ clean: clean-custom
${RM} $(OBJ) $(BIN) ${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ) $(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS) # $(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS)
consolehead.o: consolehead.c ../../head/consolehead.o: consolehead.c
$(CC) -c consolehead.c -o consolehead.o $(CFLAGS) $(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)
../head.o: ../head.c ../../head/head.o: ../head.c
$(CC) -c ../head.c -o ../head.o $(CFLAGS) $(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
/* /*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
launch4j :: Cross-platform Java application wrapper for creating Windows native executables Copyright (c) 2004, 2007 Grzegorz Kowal
Copyright (C) 2004-2005 Grzegorz Kowal
Compiled with Mingw port of GCC, Bloodshed Dev-C++ IDE (http://www.bloodshed.net/devcpp.html) Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This library is free software; you can redistribute it and/or The above copyright notice and this permission notice shall be included in
modify it under the terms of the GNU Lesser General Public all copies or substantial portions of the Software.
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, Except as contained in this notice, the name(s) of the above copyright holders
but WITHOUT ANY WARRANTY; without even the implied warranty of shall not be used in advertising or otherwise to promote the sale, use or other
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dealings in this Software without prior written authorization.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/ */
#include "../resource.h" #include "../resource.h"
...@@ -27,29 +33,32 @@ ...@@ -27,29 +33,32 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
setConsoleFlag(); setConsoleFlag();
HMODULE hLibrary = NULL; LPTSTR cmdLine = GetCommandLine();
char cmdLine[BIG_STR] = ""; if (*cmdLine == '"') {
int i; // causes error: 'for' loop initial declaration used outside C99 mode. if (*(cmdLine = strchr(cmdLine + 1, '"') + 1)) {
for (i = 1; i < argc; i++) { cmdLine++;
strcat(cmdLine, argv[i]);
if (i < argc - 1) {
strcat(cmdLine, " ");
} }
} else if ((cmdLine = strchr(cmdLine, ' ')) != NULL) {
cmdLine++;
} else {
cmdLine = "";
} }
if (!prepare(hLibrary, cmdLine)) { int result = prepare(cmdLine);
if (hLibrary != NULL) { if (result == ERROR_ALREADY_EXISTS) {
FreeLibrary(hLibrary); char errMsg[BIG_STR] = {0};
} loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
msgBox(errMsg);
closeLogFile();
return 2;
}
if (result != TRUE) {
signalError();
return 1; return 1;
} }
FreeLibrary(hLibrary);
int result = (int) execute(TRUE); result = (int) execute(TRUE);
if (result == -1) { if (result == -1) {
char errMsg[BIG_STR] = "could not start the application: "; signalError();
strcat(errMsg, strerror(errno));
msgBox(errMsg);
return 1;
} else { } else {
return result; return result;
} }
......
...@@ -7,23 +7,23 @@ Ver=1 ...@@ -7,23 +7,23 @@ Ver=1
ObjFiles= ObjFiles=
Includes= Includes=
Libs= Libs=
PrivateResource=consolehead_private.rc PrivateResource=
ResourceIncludes= ResourceIncludes=
MakeIncludes= MakeIncludes=
Compiler= Compiler=
CppCompiler= CppCompiler=
Linker= Linker=-n_@@_
IsCpp=0 IsCpp=0
Icon= Icon=
ExeOutput= ExeOutput=
ObjectOutput= ObjectOutput=..\..\head
OverrideOutput=0 OverrideOutput=0
OverrideOutputName=consolehead.exe OverrideOutputName=consolehead.exe
HostApplication= HostApplication=
Folders= Folders=
CommandLine= CommandLine=
UseCustomMakefile=0 UseCustomMakefile=0
CustomMakefile= CustomMakefile=Makefile.win
IncludeVersionInfo=0 IncludeVersionInfo=0
SupportXPThemes=0 SupportXPThemes=0
CompilerSet=0 CompilerSet=0
......
...@@ -5,11 +5,11 @@ CPP = g++.exe ...@@ -5,11 +5,11 @@ CPP = g++.exe
CC = gcc.exe CC = gcc.exe
WINDRES = windres.exe WINDRES = windres.exe
RES = RES =
OBJ = guihead.o ../head.o $(RES) OBJ = ../../head/guihead.o ../../head/head.o $(RES)
LINKOBJ = guihead.o ../head.o $(RES) LINKOBJ = ../../head/guihead.o ../../head/head.o $(RES)
LIBS = -L"lib" -mwindows LIBS = -L"C:/Dev-Cpp/lib" -mwindows -n -s
INCS = -I"include" INCS = -I"C:/Dev-Cpp/include"
CXXINCS = -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
BIN = guihead.exe BIN = guihead.exe
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3 CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
CFLAGS = $(INCS) -fexpensive-optimizations -O3 CFLAGS = $(INCS) -fexpensive-optimizations -O3
...@@ -24,10 +24,10 @@ clean: clean-custom ...@@ -24,10 +24,10 @@ clean: clean-custom
${RM} $(OBJ) $(BIN) ${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ) $(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS) # $(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS)
guihead.o: guihead.c ../../head/guihead.o: guihead.c
$(CC) -c guihead.c -o guihead.o $(CFLAGS) $(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
../head.o: ../head.c ../../head/head.o: ../head.c
$(CC) -c ../head.c -o ../head.o $(CFLAGS) $(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
/* /*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
launch4j :: Cross-platform Java application wrapper for creating Windows native executables Copyright (c) 2004, 2007 Grzegorz Kowal
Copyright (C) 2004-2005 Grzegorz Kowal Sylvain Mina (single instance patch)
Compiled with Mingw port of GCC, Bloodshed Dev-C++ IDE (http://www.bloodshed.net/devcpp.html) Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This library is free software; you can redistribute it and/or The above copyright notice and this permission notice shall be included in
modify it under the terms of the GNU Lesser General Public all copies or substantial portions of the Software.
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, Except as contained in this notice, the name(s) of the above copyright holders
but WITHOUT ANY WARRANTY; without even the implied warranty of shall not be used in advertising or otherwise to promote the sale, use or other
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dealings in this Software without prior written authorization.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/ */
#include "../resource.h" #include "../resource.h"
#include "../head.h" #include "../head.h"
#include "guihead.h" #include "guihead.h"
extern FILE* hLog;
extern PROCESS_INFORMATION pi; extern PROCESS_INFORMATION pi;
HWND hWnd; HWND hWnd;
...@@ -33,39 +41,44 @@ BOOL stayAlive = FALSE; ...@@ -33,39 +41,44 @@ BOOL stayAlive = FALSE;
BOOL splash = FALSE; BOOL splash = FALSE;
BOOL splashTimeoutErr; BOOL splashTimeoutErr;
BOOL waitForWindow; BOOL waitForWindow;
int splashTimeout; // tick count (s) int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
int APIENTRY WinMain(HINSTANCE hInstance, int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int nCmdShow) { int nCmdShow) {
HMODULE hLibrary = NULL; int result = prepare(lpCmdLine);
if (!prepare(hLibrary, lpCmdLine)) { if (result == ERROR_ALREADY_EXISTS) {
if (hLibrary != NULL) { HWND handle = getInstanceWindow();
FreeLibrary(hLibrary); ShowWindow(handle, SW_SHOW);
} SetForegroundWindow(handle);
closeLogFile();
return 2;
}
if (result != TRUE) {
signalError();
return 1; return 1;
} }
splash = loadBoolString(hLibrary, SHOW_SPLASH); splash = loadBool(SHOW_SPLASH)
stayAlive = loadBoolString(hLibrary, GUI_HEADER_STAYS_ALIVE); && strstr(lpCmdLine, "--l4j-no-splash") == NULL;
stayAlive = loadBool(GUI_HEADER_STAYS_ALIVE)
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL;
if (splash || stayAlive) { if (splash || stayAlive) {
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "", hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
WS_POPUP | SS_BITMAP, WS_POPUP | SS_BITMAP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (splash) { if (splash) {
char timeout[10] = ""; char timeout[10] = {0};
if (!loadString(hLibrary, SPLASH_TIMEOUT, timeout)) { if (loadString(SPLASH_TIMEOUT, timeout)) {
msgBox("Cannot load splash timeout property."); splashTimeout = atoi(timeout);
return 1; if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT) {
} splashTimeout = DEFAULT_SPLASH_TIMEOUT;
splashTimeout = atoi(timeout); }
if (splashTimeout <= 0 || splashTimeout > 60 * 15 /* 15 minutes */) {
msgBox("Invalid splash timeout property.");
return 1;
} }
splashTimeoutErr = loadBoolString(hLibrary, SPLASH_TIMEOUT_ERR); splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
waitForWindow = loadBoolString(hLibrary, SPLASH_WAITS_FOR_WINDOW); && strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
IMAGE_BITMAP, // type of image IMAGE_BITMAP, // type of image
...@@ -73,7 +86,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, ...@@ -73,7 +86,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
0, // desired height 0, // desired height
LR_DEFAULTSIZE); LR_DEFAULTSIZE);
if (hImage == NULL) { if (hImage == NULL) {
msgBox("Cannot load splash screen."); signalError();
return 1; return 1;
} }
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage); SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
...@@ -86,29 +99,47 @@ int APIENTRY WinMain(HINSTANCE hInstance, ...@@ -86,29 +99,47 @@ int APIENTRY WinMain(HINSTANCE hInstance,
UpdateWindow (hWnd); UpdateWindow (hWnd);
} }
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc)) { if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc)) {
signalError();
return 1; return 1;
} }
} }
FreeLibrary(hLibrary);
if (execute(FALSE) == -1) { if (execute(FALSE) == -1) {
char errMsg[BIG_STR] = "Error occured while starting the application...\n"; signalError();
strcat(errMsg, strerror(errno));
msgBox(errMsg);
return 1; return 1;
} }
if (!(splash || stayAlive)) { if (!(splash || stayAlive)) {
debug("Exit code:\t0\n");
closeHandles(); closeHandles();
return 0; return 0;
} }
MSG msg; MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) { while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
debug("Exit code:\t%d\n", dwExitCode);
closeHandles(); closeHandles();
return dwExitCode; return dwExitCode;
} }
HWND getInstanceWindow() {
char windowTitle[STR];
char instWindowTitle[STR] = {0};
if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle)) {
HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
while (handle != NULL) {
GetWindowText(handle, windowTitle, STR - 1);
if (strstr(windowTitle, instWindowTitle) != NULL) {
return handle;
} else {
handle = FindWindowEx(NULL, handle, NULL, NULL);
}
}
}
return NULL;
}
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam) { BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam) {
DWORD processId; DWORD processId;
GetWindowThreadProcessId(hwnd, &processId); GetWindowThreadProcessId(hwnd, &processId);
...@@ -135,7 +166,7 @@ VOID CALLBACK TimerProc( ...@@ -135,7 +166,7 @@ VOID CALLBACK TimerProc(
ShowWindow(hWnd, SW_HIDE); ShowWindow(hWnd, SW_HIDE);
if (waitForWindow && splashTimeoutErr) { if (waitForWindow && splashTimeoutErr) {
KillTimer(hwnd, ID_TIMER); KillTimer(hwnd, ID_TIMER);
msgBox("Could not start the application, operation timed out."); signalError();
PostQuitMessage(0); PostQuitMessage(0);
} }
} else { } else {
...@@ -149,7 +180,6 @@ VOID CALLBACK TimerProc( ...@@ -149,7 +180,6 @@ VOID CALLBACK TimerProc(
if (dwExitCode != STILL_ACTIVE if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive)) { || !(splash || stayAlive)) {
KillTimer(hWnd, ID_TIMER); KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0); PostQuitMessage(0);
return;
} }
} }
...@@ -12,22 +12,22 @@ ResourceIncludes= ...@@ -12,22 +12,22 @@ ResourceIncludes=
MakeIncludes= MakeIncludes=
Compiler= Compiler=
CppCompiler= CppCompiler=
Linker=_@@_ Linker=-n_@@_
IsCpp=0 IsCpp=0
Icon= Icon=
ExeOutput= ExeOutput=
ObjectOutput= ObjectOutput=..\..\head
OverrideOutput=0 OverrideOutput=0
OverrideOutputName=guihead.exe OverrideOutputName=guihead.exe
HostApplication= HostApplication=
Folders= Folders=
CommandLine= CommandLine=
UseCustomMakefile=0 UseCustomMakefile=1
CustomMakefile= CustomMakefile=Makefile.win
IncludeVersionInfo=0 IncludeVersionInfo=0
SupportXPThemes=0 SupportXPThemes=0
CompilerSet=0 CompilerSet=0
CompilerSettings=0000000001001000000000 CompilerSettings=0000000001001000000100
[Unit1] [Unit1]
FileName=guihead.c FileName=guihead.c
...@@ -37,7 +37,7 @@ Compile=1 ...@@ -37,7 +37,7 @@ Compile=1
Link=1 Link=1
Priority=1000 Priority=1000
OverrideBuildCmd=0 OverrideBuildCmd=0
BuildCmd= BuildCmd=$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
[Unit2] [Unit2]
FileName=guihead.h FileName=guihead.h
...@@ -78,16 +78,6 @@ OverrideBuildCmd=0 ...@@ -78,16 +78,6 @@ OverrideBuildCmd=0
BuildCmd= BuildCmd=
[Unit6] [Unit6]
FileName=..\resource.h
Folder=guihead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
CompileCpp=0
[Unit7]
FileName=..\resid.h FileName=..\resid.h
CompileCpp=0 CompileCpp=0
Folder=guihead Folder=guihead
......
/* /*
Launch4j (http://launch4j.sourceforge.net/)
launch4j :: Cross-platform Java application wrapper for creating Windows native executables Cross-platform Java application wrapper for creating Windows native executables.
Copyright (C) 2004-2005 Grzegorz Kowal
Copyright (c) 2004, 2007 Grzegorz Kowal
Compiled with Mingw port of GCC, Bloodshed Dev-C++ IDE (http://www.bloodshed.net/devcpp.html)
Permission is hereby granted, free of charge, to any person obtaining a copy
This library is free software; you can redistribute it and/or of this software and associated documentation files (the "Software"), to deal
modify it under the terms of the GNU Lesser General Public in the Software without restriction, including without limitation the rights
License as published by the Free Software Foundation; either to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
version 2.1 of the License, or (at your option) any later version. copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of The above copyright notice and this permission notice shall be included in
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU all copies or substantial portions of the Software.
Lesser General Public License for more details.
Except as contained in this notice, the name(s) of the above copyright holders
You should have received a copy of the GNU Lesser General Public shall not be used in advertising or otherwise to promote the sale, use or other
License along with this library; if not, write to the Free Software dealings in this Software without prior written authorization.
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/ */
#define ID_TIMER 1 #define ID_TIMER 1
#define DEFAULT_SPLASH_TIMEOUT 60 /* 60 seconds */
#define MAX_SPLASH_TIMEOUT 60 * 15 /* 15 minutes */
HWND getInstanceWindow();
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam);
VOID CALLBACK TimerProc( VOID CALLBACK TimerProc(
HWND hwnd, // handle of window for timer messages HWND hwnd, // handle of window for timer messages
......
This diff is collapsed.
/* /*
Launch4j (http://launch4j.sourceforge.net/)
launch4j :: Cross-platform Java application wrapper for creating Windows native executables Cross-platform Java application wrapper for creating Windows native executables.
Copyright (C) 2004-2005 Grzegorz Kowal
Copyright (c) 2004, 2008 Grzegorz Kowal,
Compiled with Mingw port of GCC, Bloodshed Dev-C++ IDE (http://www.bloodshed.net/devcpp.html) Ian Roberts (jdk preference patch)
This library is free software; you can redistribute it and/or Permission is hereby granted, free of charge, to any person obtaining a copy
modify it under the terms of the GNU Lesser General Public of this software and associated documentation files (the "Software"), to deal
License as published by the Free Software Foundation; either in the Software without restriction, including without limitation the rights
version 2.1 of the License, or (at your option) any later version. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
This library is distributed in the hope that it will be useful, furnished to do so, subject to the following conditions:
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU The above copyright notice and this permission notice shall be included in
Lesser General Public License for more details. all copies or substantial portions of the Software.
You should have received a copy of the GNU Lesser General Public Except as contained in this notice, the name(s) of the above copyright holders
License along with this library; if not, write to the Free Software shall not be used in advertising or otherwise to promote the sale, use or other
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/ */
#ifndef _LAUNCH4J_HEAD__INCLUDED_ #ifndef _LAUNCH4J_HEAD__INCLUDED_
...@@ -36,6 +43,7 @@ ...@@ -36,6 +43,7 @@
#include <tchar.h> #include <tchar.h>
#include <shellapi.h> #include <shellapi.h>
#include <direct.h> #include <direct.h>
#include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <io.h> #include <io.h>
...@@ -45,25 +53,61 @@ ...@@ -45,25 +53,61 @@
#define FOUND_JRE 1 #define FOUND_JRE 1
#define FOUND_SDK 2 #define FOUND_SDK 2
#define JRE_ONLY 0
#define PREFER_JRE 1
#define PREFER_JDK 2
#define JDK_ONLY 3
#define LAUNCH4J_TMP_DIR "\\launch4j-tmp\\" #define LAUNCH4J_TMP_DIR "\\launch4j-tmp\\"
#define MANIFEST ".manifest"
#define KEY_WOW64_64KEY 0x0100
#define HKEY_STR "HKEY"
#define HKEY_CLASSES_ROOT_STR "HKEY_CLASSES_ROOT"
#define HKEY_CURRENT_USER_STR "HKEY_CURRENT_USER"
#define HKEY_LOCAL_MACHINE_STR "HKEY_LOCAL_MACHINE"
#define HKEY_USERS_STR "HKEY_USERS"
#define HKEY_CURRENT_CONFIG_STR "HKEY_CURRENT_CONFIG"
#define STR 128 #define STR 128
#define BIG_STR 1024 #define BIG_STR 1024
#define MAX_VAR_SIZE 32767
#define MAX_ARGS 32768
#define TRUE_STR "true" #define TRUE_STR "true"
#define FALSE_STR "false" #define FALSE_STR "false"
#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
FILE* openLogFile(const char* exePath, const int pathLen);
void closeLogFile();
void msgBox(const char* text); void msgBox(const char* text);
void showJavaWebPage(); void signalError();
BOOL loadString(HMODULE hLibrary, int resID, char* buffer); BOOL loadString(const int resID, char* buffer);
BOOL loadBoolString(HMODULE hLibrary, int resID); BOOL loadBool(const int resID);
void regSearch(HKEY hKey, char* keyName, int searchType); int loadInt(const int resID);
BOOL findJavaHome(char* path); BOOL regQueryValue(const char* regPath, unsigned char* buffer,
unsigned long bufferLength);
void regSearch(const HKEY hKey, const char* keyName, const int searchType);
void regSearchWow(const char* keyName, const int searchType);
void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
const int jdkPreference);
BOOL findJavaHome(char* path, const int jdkPreference);
int getExePath(char* exePath); int getExePath(char* exePath);
void catJavaw(char* jrePath); void appendPath(char* basepath, const char* path);
BOOL isJrePathOk(char* path); void appendJavaw(char* jrePath);
BOOL prepare(HMODULE hLibrary, char *lpCmdLine); void appendAppClasspath(char* dst, const char* src, const char* classpath);
BOOL isJrePathOk(const char* path);
BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathLen);
void appendHeapSizes(char *dst);
void appendHeapSize(char *dst, const int absID, const int percentID,
const DWORD freeMemory, const char *option);
int prepare(const char *lpCmdLine);
void closeHandles(); void closeHandles();
DWORD execute(BOOL wait); BOOL appendToPathVar(const char* path);
DWORD execute(const BOOL wait);
#endif // _LAUNCH4J_HEAD__INCLUDED_ #endif // _LAUNCH4J_HEAD__INCLUDED_
/* /*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
launch4j :: Cross-platform Java application wrapper for creating Windows native executables Copyright (c) 2004, 2008 Grzegorz Kowal
Copyright (C) 2004-2005 Grzegorz Kowal Ian Roberts (jdk preference patch)
Compiled with Mingw port of GCC, Bloodshed Dev-C++ IDE (http://www.bloodshed.net/devcpp.html) Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This library is free software; you can redistribute it and/or The above copyright notice and this permission notice shall be included in
modify it under the terms of the GNU Lesser General Public all copies or substantial portions of the Software.
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, Except as contained in this notice, the name(s) of the above copyright holders
but WITHOUT ANY WARRANTY; without even the implied warranty of shall not be used in advertising or otherwise to promote the sale, use or other
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dealings in this Software without prior written authorization.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/ */
// ICON // ICON
#define APP_ICON 1 #define APP_ICON 1
// BITMAP // BITMAP
#define SPLASH_BITMAP 1 #define SPLASH_BITMAP 1
// RCDATA // RCDATA
#define JRE_PATH 1 #define JRE_PATH 1
#define JAVA_MIN_VER 2 #define JAVA_MIN_VER 2
#define JAVA_MAX_VER 3 #define JAVA_MAX_VER 3
#define SHOW_SPLASH 4 #define SHOW_SPLASH 4
#define SPLASH_WAITS_FOR_WINDOW 5 #define SPLASH_WAITS_FOR_WINDOW 5
#define SPLASH_TIMEOUT 6 #define SPLASH_TIMEOUT 6
#define SPLASH_TIMEOUT_ERR 7 #define SPLASH_TIMEOUT_ERR 7
#define CHDIR 8 #define CHDIR 8
#define SET_PROC_NAME 9 #define SET_PROC_NAME 9
#define ERR_TITLE 10 #define ERR_TITLE 10
#define GUI_HEADER_STAYS_ALIVE 11 #define GUI_HEADER_STAYS_ALIVE 11
#define JVM_ARGS 12 #define JVM_OPTIONS 12
#define JAR_ARGS 13 #define CMD_LINE 13
#define JAR 14
#define MAIN_CLASS 15
#define CLASSPATH 16
#define WRAPPER 17
#define JDK_PREFERENCE 18
#define ENV_VARIABLES 19
#define PRIORITY_CLASS 20
#define DOWNLOAD_URL 21
#define SUPPORT_URL 22
#define MUTEX_NAME 23
#define INSTANCE_WINDOW_TITLE 24
#define INITIAL_HEAP_SIZE 25
#define INITIAL_HEAP_PERCENT 26
#define MAX_HEAP_SIZE 27
#define MAX_HEAP_PERCENT 28
#define STARTUP_ERR 101
#define BUNDLED_JRE_ERR 102
#define JRE_VERSION_ERR 103
#define LAUNCHER_ERR 104
#define INSTANCE_ALREADY_EXISTS_MSG 105
No preview for this file type
The BSD License for the JGoodies Looks
======================================
Copyright (c) 2003 JGoodies Karsten Lentzsch. All rights reserved. The BSD License for the JGoodies Looks
======================================
Copyright (c) 2001-2007 JGoodies Karsten Lentzsch. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
......
This diff is collapsed.
(BSD Style License) (BSD Style License)
Copyright (c) 2003-2004, Joe Walnes Copyright (c) 2003-2004, Joe Walnes
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer in the above copyright notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution. the documentation and/or other materials provided with the distribution.
Neither the name of XStream nor the names of its contributors may be used to endorse Neither the name of XStream nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written or promote products derived from this software without specific prior written
permission. permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
File added
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment