Added about panel
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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.
|
||||
@@ -0,0 +1,2 @@
|
||||
/consolehead.exe
|
||||
/consolehead.layout
|
||||
@@ -0,0 +1,33 @@
|
||||
# Project: consolehead
|
||||
# Makefile created by Dev-C++ 4.9.9.2
|
||||
|
||||
CPP = g++.exe
|
||||
CC = gcc.exe
|
||||
WINDRES = windres.exe
|
||||
RES =
|
||||
OBJ = ../../head/consolehead.o ../../head/head.o $(RES)
|
||||
LINKOBJ = ../../head/consolehead.o ../../head/head.o $(RES)
|
||||
LIBS = -L"C:/Dev-Cpp/lib" -n -s
|
||||
INCS = -I"C:/Dev-Cpp/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
|
||||
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
|
||||
CFLAGS = $(INCS) -fexpensive-optimizations -O3
|
||||
RM = rm -f
|
||||
|
||||
.PHONY: all all-before all-after clean clean-custom
|
||||
|
||||
all: all-before consolehead.exe all-after
|
||||
|
||||
|
||||
clean: clean-custom
|
||||
${RM} $(OBJ) $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
# $(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS)
|
||||
|
||||
../../head/consolehead.o: consolehead.c
|
||||
$(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)
|
||||
|
||||
../../head/head.o: ../head.c
|
||||
$(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2007 Grzegorz Kowal
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "../resource.h"
|
||||
#include "../head.h"
|
||||
|
||||
extern FILE* hLog;
|
||||
|
||||
BOOL restartOnCrash = FALSE;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
setConsoleFlag();
|
||||
LPTSTR cmdLine = GetCommandLine();
|
||||
|
||||
if (*cmdLine == '"')
|
||||
{
|
||||
if (*(cmdLine = strchr(cmdLine + 1, '"') + 1))
|
||||
{
|
||||
cmdLine++;
|
||||
}
|
||||
}
|
||||
else if ((cmdLine = strchr(cmdLine, ' ')) != NULL)
|
||||
{
|
||||
cmdLine++;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdLine = "";
|
||||
}
|
||||
|
||||
int result = prepare(cmdLine);
|
||||
|
||||
if (result == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
char errMsg[BIG_STR] = {0};
|
||||
loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
|
||||
msgBox(errMsg);
|
||||
closeLogFile();
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (result != TRUE)
|
||||
{
|
||||
signalError();
|
||||
return 1;
|
||||
}
|
||||
|
||||
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
||||
DWORD dwExitCode;
|
||||
|
||||
do
|
||||
{
|
||||
dwExitCode = 0;
|
||||
|
||||
if (!execute(TRUE, &dwExitCode))
|
||||
{
|
||||
signalError();
|
||||
break;
|
||||
}
|
||||
|
||||
if (restartOnCrash && dwExitCode != 0)
|
||||
{
|
||||
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
||||
}
|
||||
} while (restartOnCrash && dwExitCode != 0);
|
||||
|
||||
debug("Exit code:\t%d\n", dwExitCode);
|
||||
closeLogFile();
|
||||
return (int) dwExitCode;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
[Project]
|
||||
FileName=consolehead.dev
|
||||
Name=consolehead
|
||||
UnitCount=4
|
||||
Type=1
|
||||
Ver=1
|
||||
ObjFiles=
|
||||
Includes=
|
||||
Libs=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Compiler=
|
||||
CppCompiler=
|
||||
Linker=-n_@@_
|
||||
IsCpp=0
|
||||
Icon=
|
||||
ExeOutput=
|
||||
ObjectOutput=..\..\head
|
||||
OverrideOutput=0
|
||||
OverrideOutputName=consolehead.exe
|
||||
HostApplication=
|
||||
Folders=
|
||||
CommandLine=
|
||||
UseCustomMakefile=1
|
||||
CustomMakefile=Makefile.win
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=0000000001001000000100
|
||||
|
||||
[Unit1]
|
||||
FileName=consolehead.c
|
||||
CompileCpp=0
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=
|
||||
AutoIncBuildNr=0
|
||||
|
||||
[Unit2]
|
||||
FileName=..\resource.h
|
||||
CompileCpp=0
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit3]
|
||||
FileName=..\head.c
|
||||
CompileCpp=0
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit4]
|
||||
FileName=..\head.h
|
||||
CompileCpp=0
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit5]
|
||||
FileName=..\head.rc
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=0
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit6]
|
||||
FileName=..\resid.h
|
||||
CompileCpp=0
|
||||
Folder=consolehead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/guihead.exe
|
||||
/guihead.layout
|
||||
@@ -0,0 +1,33 @@
|
||||
# Project: guihead
|
||||
# Makefile created by Dev-C++ 4.9.9.2
|
||||
|
||||
CPP = g++.exe
|
||||
CC = gcc.exe
|
||||
WINDRES = windres.exe
|
||||
RES =
|
||||
OBJ = ../../head/guihead.o ../../head/head.o $(RES)
|
||||
LINKOBJ = ../../head/guihead.o ../../head/head.o $(RES)
|
||||
LIBS = -L"C:/Dev-Cpp/lib" -mwindows -n -s
|
||||
INCS = -I"C:/Dev-Cpp/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
|
||||
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
|
||||
CFLAGS = $(INCS) -fexpensive-optimizations -O3
|
||||
RM = rm -f
|
||||
|
||||
.PHONY: all all-before all-after clean clean-custom
|
||||
|
||||
all: all-before guihead.exe all-after
|
||||
|
||||
|
||||
clean: clean-custom
|
||||
${RM} $(OBJ) $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
# $(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS)
|
||||
|
||||
../../head/guihead.o: guihead.c
|
||||
$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
|
||||
|
||||
../../head/head.o: ../head.c
|
||||
$(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
|
||||
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||
Sylvain Mina (single instance patch)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "../resource.h"
|
||||
#include "../head.h"
|
||||
#include "guihead.h"
|
||||
|
||||
extern FILE* hLog;
|
||||
extern PROCESS_INFORMATION processInformation;
|
||||
|
||||
HWND hWnd;
|
||||
DWORD dwExitCode = 0;
|
||||
BOOL stayAlive = FALSE;
|
||||
BOOL splash = FALSE;
|
||||
BOOL splashTimeoutErr;
|
||||
BOOL waitForWindow;
|
||||
BOOL restartOnCrash = FALSE;
|
||||
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
int result = prepare(lpCmdLine);
|
||||
|
||||
if (result == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
HWND handle = getInstanceWindow();
|
||||
ShowWindow(handle, SW_SHOW);
|
||||
SetForegroundWindow(handle);
|
||||
closeLogFile();
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (result != TRUE)
|
||||
{
|
||||
signalError();
|
||||
return 1;
|
||||
}
|
||||
|
||||
splash = loadBool(SHOW_SPLASH)
|
||||
&& strstr(lpCmdLine, "--l4j-no-splash") == NULL;
|
||||
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
||||
|
||||
// if we should restart on crash, we must also stay alive to check for crashes
|
||||
stayAlive = restartOnCrash ||
|
||||
(loadBool(GUI_HEADER_STAYS_ALIVE)
|
||||
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL);
|
||||
|
||||
if (splash || stayAlive)
|
||||
{
|
||||
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
|
||||
WS_POPUP | SS_BITMAP,
|
||||
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
|
||||
if (splash)
|
||||
{
|
||||
char timeout[10] = {0};
|
||||
if (loadString(SPLASH_TIMEOUT, timeout))
|
||||
{
|
||||
splashTimeout = atoi(timeout);
|
||||
if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT)
|
||||
{
|
||||
splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
||||
}
|
||||
}
|
||||
splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
|
||||
&& strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
|
||||
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
|
||||
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
|
||||
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
|
||||
IMAGE_BITMAP, // type of image
|
||||
0, // desired width
|
||||
0, // desired height
|
||||
LR_DEFAULTSIZE);
|
||||
if (hImage == NULL)
|
||||
{
|
||||
signalError();
|
||||
return 1;
|
||||
}
|
||||
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
|
||||
RECT rect;
|
||||
GetWindowRect(hWnd, &rect);
|
||||
int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||
int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||
SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow (hWnd);
|
||||
}
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (splash || stayAlive)
|
||||
{
|
||||
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc))
|
||||
{
|
||||
signalError();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!execute(FALSE, &dwExitCode))
|
||||
{
|
||||
signalError();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!(splash || stayAlive))
|
||||
{
|
||||
debug("Exit code:\t0\n");
|
||||
closeProcessHandles();
|
||||
closeLogFile();
|
||||
return 0;
|
||||
}
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
if (restartOnCrash && dwExitCode != 0)
|
||||
{
|
||||
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
||||
}
|
||||
|
||||
closeProcessHandles();
|
||||
} while (restartOnCrash && dwExitCode != 0);
|
||||
|
||||
debug("Exit code:\t%d\n", dwExitCode);
|
||||
closeLogFile();
|
||||
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)
|
||||
{
|
||||
DWORD processId;
|
||||
GetWindowThreadProcessId(hwnd, &processId);
|
||||
if (processInformation.dwProcessId == processId)
|
||||
{
|
||||
LONG styles = GetWindowLong(hwnd, GWL_STYLE);
|
||||
if ((styles & WS_VISIBLE) != 0)
|
||||
{
|
||||
splash = FALSE;
|
||||
ShowWindow(hWnd, SW_HIDE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID CALLBACK TimerProc(
|
||||
HWND hwnd, // handle of window for timer messages
|
||||
UINT uMsg, // WM_TIMER message
|
||||
UINT idEvent, // timer identifier
|
||||
DWORD dwTime) // current system time
|
||||
{
|
||||
if (splash)
|
||||
{
|
||||
if (splashTimeout == 0)
|
||||
{
|
||||
splash = FALSE;
|
||||
ShowWindow(hWnd, SW_HIDE);
|
||||
if (waitForWindow && splashTimeoutErr)
|
||||
{
|
||||
KillTimer(hwnd, ID_TIMER);
|
||||
signalError();
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
splashTimeout--;
|
||||
if (waitForWindow)
|
||||
{
|
||||
EnumWindows(enumwndfn, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
|
||||
if (dwExitCode != STILL_ACTIVE
|
||||
|| !(splash || stayAlive))
|
||||
{
|
||||
KillTimer(hWnd, ID_TIMER);
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
[Project]
|
||||
FileName=guihead.dev
|
||||
Name=guihead
|
||||
UnitCount=5
|
||||
Type=0
|
||||
Ver=1
|
||||
ObjFiles=
|
||||
Includes=
|
||||
Libs=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Compiler=
|
||||
CppCompiler=
|
||||
Linker=-n_@@_
|
||||
IsCpp=0
|
||||
Icon=
|
||||
ExeOutput=
|
||||
ObjectOutput=..\..\head
|
||||
OverrideOutput=0
|
||||
OverrideOutputName=guihead.exe
|
||||
HostApplication=
|
||||
Folders=
|
||||
CommandLine=
|
||||
UseCustomMakefile=1
|
||||
CustomMakefile=Makefile.win
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=0000000001001000000100
|
||||
|
||||
[Unit1]
|
||||
FileName=guihead.c
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
|
||||
|
||||
[Unit2]
|
||||
FileName=guihead.h
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=
|
||||
AutoIncBuildNr=0
|
||||
|
||||
[Unit4]
|
||||
FileName=..\head.h
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit6]
|
||||
FileName=..\resid.h
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit3]
|
||||
FileName=..\head.c
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit5]
|
||||
FileName=..\resource.h
|
||||
CompileCpp=0
|
||||
Folder=guihead
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2007 Grzegorz Kowal
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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.
|
||||
*/
|
||||
|
||||
#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(
|
||||
HWND hwnd, // handle of window for timer messages
|
||||
UINT uMsg, // WM_TIMER message
|
||||
UINT idEvent, // timer identifier
|
||||
DWORD dwTime // current system time
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2015 Grzegorz Kowal,
|
||||
Ian Roberts (jdk preference patch)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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_
|
||||
#define _LAUNCH4J_HEAD__INCLUDED_
|
||||
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
|
||||
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
|
||||
// C RunTime Header Files
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
||||
#include <shellapi.h>
|
||||
#include <direct.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <io.h>
|
||||
#include <process.h>
|
||||
|
||||
#define LAUNCH4j "Launch4j"
|
||||
#define VERSION "3.7"
|
||||
|
||||
#define NO_JAVA_FOUND 0
|
||||
#define FOUND_JRE 1
|
||||
#define FOUND_SDK 2
|
||||
#define FOUND_BUNDLED 4
|
||||
|
||||
#define JRE_ONLY 0
|
||||
#define PREFER_JRE 1
|
||||
#define PREFER_JDK 2
|
||||
#define JDK_ONLY 3
|
||||
|
||||
#define USE_64_BIT_RUNTIME 1
|
||||
#define USE_64_AND_32_BIT_RUNTIME 2
|
||||
#define USE_32_AND_64_BIT_RUNTIME 3
|
||||
#define USE_32_BIT_RUNTIME 4
|
||||
#define INIT_RUNTIME_BITS 9
|
||||
|
||||
#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 BIG_STR 1024
|
||||
#define MAX_VAR_SIZE 32767
|
||||
#define MAX_ARGS 32768
|
||||
|
||||
#define TRUE_STR "true"
|
||||
#define FALSE_STR "false"
|
||||
|
||||
#define ERROR_FORMAT "Error:\t\t%s\n"
|
||||
#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
|
||||
|
||||
typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
|
||||
|
||||
BOOL initGlobals();
|
||||
FILE* openLogFile(const char* exePath, const int pathLen);
|
||||
void closeLogFile();
|
||||
BOOL initializeLogging(const char *lpCmdLine, const char* exePath, const int pathLen);
|
||||
void msgBox(const char* text);
|
||||
void signalError();
|
||||
BOOL loadString(const int resID, char* buffer);
|
||||
BOOL loadBool(const int resID);
|
||||
int loadInt(const int resID);
|
||||
BOOL regQueryValue(const char* regPath, unsigned char* buffer,
|
||||
unsigned long bufferLength);
|
||||
void regSearch(const char* keyName, const int searchType);
|
||||
BOOL isJavaHomeValid(const char* keyName, const int searchType);
|
||||
BOOL isLauncherPathValid(const char* path);
|
||||
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);
|
||||
void appendPath(char* basepath, const char* path);
|
||||
void appendLauncher(char* jrePath);
|
||||
void appendAppClasspath(char* dst, const char* src);
|
||||
BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathLen);
|
||||
void appendHeapSizes(char *dst);
|
||||
void appendHeapSize(char *dst, const int megabytesID, const int percentID,
|
||||
const DWORDLONG availableMemory, const char *option);
|
||||
void setJvmOptions(char *jvmOptions, const char *exePath);
|
||||
BOOL createMutex();
|
||||
void setWorkingDirectory(const char *exePath, const int pathLen);
|
||||
BOOL bundledJreSearch(const char *exePath, const int pathLen);
|
||||
BOOL installedJreSearch();
|
||||
void createJreSearchError();
|
||||
BOOL jreSearch(const char *exePath, const int pathLen);
|
||||
BOOL appendToPathVar(const char* path);
|
||||
BOOL appendJreBinToPathVar();
|
||||
void setEnvironmentVariables(const char *exePath, const int pathLen);
|
||||
void setMainClassAndClassPath(const char *exePath, const int pathLen);
|
||||
void setCommandLineArgs(const char *lpCmdLine);
|
||||
int prepare(const char *lpCmdLine);
|
||||
void closeProcessHandles();
|
||||
BOOL execute(const BOOL wait, DWORD *dwExitCode);
|
||||
|
||||
#endif // _LAUNCH4J_HEAD__INCLUDED_
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
Launch4j (http://launch4j.sourceforge.net/)
|
||||
Cross-platform Java application wrapper for creating Windows native executables.
|
||||
|
||||
Copyright (c) 2004, 2014 Grzegorz Kowal
|
||||
Ian Roberts (jdk preference patch)
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||
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.
|
||||
*/
|
||||
|
||||
// ICON
|
||||
#define APP_ICON 1
|
||||
|
||||
// BITMAP
|
||||
#define SPLASH_BITMAP 1
|
||||
|
||||
// RCDATA
|
||||
#define JRE_PATH 1
|
||||
#define JAVA_MIN_VER 2
|
||||
#define JAVA_MAX_VER 3
|
||||
#define SHOW_SPLASH 4
|
||||
#define SPLASH_WAITS_FOR_WINDOW 5
|
||||
#define SPLASH_TIMEOUT 6
|
||||
#define SPLASH_TIMEOUT_ERR 7
|
||||
#define CHDIR 8
|
||||
#define SET_PROC_NAME 9
|
||||
#define ERR_TITLE 10
|
||||
#define GUI_HEADER_STAYS_ALIVE 11
|
||||
#define JVM_OPTIONS 12
|
||||
#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 BUNDLED_JRE_64_BIT 29
|
||||
#define RUNTIME_BITS 30
|
||||
#define RESTART_ON_CRASH 31
|
||||
#define BUNDLED_JRE_AS_FALLBACK 32
|
||||
|
||||
#define STARTUP_ERR 101
|
||||
#define BUNDLED_JRE_ERR 102
|
||||
#define JRE_VERSION_ERR 103
|
||||
#define LAUNCHER_ERR 104
|
||||
#define INSTANCE_ALREADY_EXISTS_MSG 105
|
||||
Reference in New Issue
Block a user