JBoss Native SVN: r1500 - in trunk: httpd/httpd-2.2 and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:58:56 -0400 (Wed, 02 Apr 2008)
New Revision: 1500
Modified:
trunk/build/NMAKEcommon.inc
trunk/httpd/httpd-2.2/NMAKEcommon.inc
trunk/utils/windows/native/service/procrun/NMAKEcommon.inc
Log:
Use correct /MACHINE linker flag
Modified: trunk/build/NMAKEcommon.inc
===================================================================
--- trunk/build/NMAKEcommon.inc 2008-04-02 12:44:26 UTC (rev 1499)
+++ trunk/build/NMAKEcommon.inc 2008-04-02 12:58:56 UTC (rev 1500)
@@ -211,10 +211,13 @@
!IF "$(CPU)" == "X86"
CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
!ELSEIF "$(CPU)" == "X64"
CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=AMD64
!ELSEIF "$(CPU)" == "I64"
CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=IA64
!ENDIF
!IF "$(INCLUDE_PRE64PRA)" == "1"
@@ -271,11 +274,11 @@
!ENDIF
!IF "$(TARGET)" == "EXE"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "GUI"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "DLL"
-LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "LIB"
LFLAGS = -lib $(COMMON_LFLAGS)
!ENDIF
Modified: trunk/httpd/httpd-2.2/NMAKEcommon.inc
===================================================================
--- trunk/httpd/httpd-2.2/NMAKEcommon.inc 2008-04-02 12:44:26 UTC (rev 1499)
+++ trunk/httpd/httpd-2.2/NMAKEcommon.inc 2008-04-02 12:58:56 UTC (rev 1500)
@@ -205,13 +205,19 @@
# Common flags for all platforms
CMN_CFLAGS = -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT) -W3
+!IF "$(TARGET)" == "EXE"
+CMN_CFLAGS = $(CMN_CFLAGS) -D_CONSOLE
+!ENDIF
!IF "$(CPU)" == "X86"
CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
!ELSEIF "$(CPU)" == "X64"
CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=AMD64
!ELSEIF "$(CPU)" == "I64"
CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=IA64
!ENDIF
!IF "$(INCLUDE_PRE64PRA)" == "1"
@@ -268,11 +274,11 @@
!ENDIF
!IF "$(TARGET)" == "EXE"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "GUI"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "DLL"
-LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "LIB"
LFLAGS = -lib $(COMMON_LFLAGS)
!ENDIF
Modified: trunk/utils/windows/native/service/procrun/NMAKEcommon.inc
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEcommon.inc 2008-04-02 12:44:26 UTC (rev 1499)
+++ trunk/utils/windows/native/service/procrun/NMAKEcommon.inc 2008-04-02 12:58:56 UTC (rev 1500)
@@ -211,10 +211,13 @@
!IF "$(CPU)" == "X86"
CPU_CFLAGS = -D_X86_=1
+MACHINE=X86
!ELSEIF "$(CPU)" == "X64"
CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=AMD64
!ELSEIF "$(CPU)" == "I64"
CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64 -Wp64
+MACHINE=IA64
!ENDIF
!IF "$(INCLUDE_PRE64PRA)" == "1"
@@ -271,11 +274,11 @@
!ENDIF
!IF "$(TARGET)" == "EXE"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "GUI"
-LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "DLL"
-LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
+LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(MACHINE)
!ELSEIF "$(TARGET)" == "LIB"
LFLAGS = -lib $(COMMON_LFLAGS)
!ENDIF
16 years, 5 months
JBoss Native SVN: r1499 - in trunk/srclib: apr-iconv and 3 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:44:26 -0400 (Wed, 02 Apr 2008)
New Revision: 1499
Modified:
trunk/srclib/apr-iconv/NMAKEmakefile
trunk/srclib/apr-util/NMAKEmakefile
trunk/srclib/apr/NMAKEmakefile
trunk/srclib/tomcat-native/NMAKEmakefile
trunk/srclib/zlib/NMAKEmakefile
Log:
Add linker major.minor version for components
Modified: trunk/srclib/apr/NMAKEmakefile
===================================================================
--- trunk/srclib/apr/NMAKEmakefile 2008-04-02 12:41:26 UTC (rev 1498)
+++ trunk/srclib/apr/NMAKEmakefile 2008-04-02 12:44:26 UTC (rev 1499)
@@ -41,6 +41,7 @@
!include <..\..\NMAKEcommon.inc>
+LFLAGS = $(LFLAGS) /version:1.2
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\include\arch -I$(SRCDIR)\include\arch\win32 -I$(SRCDIR)\include\arch\unix
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
OBJECTS = \
Modified: trunk/srclib/apr-iconv/NMAKEmakefile
===================================================================
--- trunk/srclib/apr-iconv/NMAKEmakefile 2008-04-02 12:41:26 UTC (rev 1498)
+++ trunk/srclib/apr-iconv/NMAKEmakefile 2008-04-02 12:44:26 UTC (rev 1499)
@@ -50,6 +50,7 @@
LDIRS = /libpath:"$(WITH_APR)\lib"
+LFLAGS = $(LFLAGS) /version:1.2
LFLAGS = $(LFLAGS) $(APR_LIB)
!IF "$(TARGET)" == "DLL"
LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib
Modified: trunk/srclib/apr-util/NMAKEmakefile
===================================================================
--- trunk/srclib/apr-util/NMAKEmakefile 2008-04-02 12:41:26 UTC (rev 1498)
+++ trunk/srclib/apr-util/NMAKEmakefile 2008-04-02 12:44:26 UTC (rev 1499)
@@ -52,6 +52,7 @@
LDIRS = /libpath:"$(WITH_APR)\lib"
+LFLAGS = $(LFLAGS) /version:1.2
LFLAGS = $(LFLAGS) $(APR_LIB)
!IF "$(TARGET)" == "DLL"
LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib
Modified: trunk/srclib/tomcat-native/NMAKEmakefile
===================================================================
--- trunk/srclib/tomcat-native/NMAKEmakefile 2008-04-02 12:41:26 UTC (rev 1498)
+++ trunk/srclib/tomcat-native/NMAKEmakefile 2008-04-02 12:44:26 UTC (rev 1499)
@@ -64,6 +64,7 @@
LDIRS = /libpath:"$(WITH_APR)\lib"
+LFLAGS = $(LFLAGS) /version:1.1
LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib
LFLAGS = $(LFLAGS) $(APR_LIB) $(APU_LIB)
!IF DEFINED(WITH_OPENSSL) && "$(WITH_OPENSSL)" != "no"
Modified: trunk/srclib/zlib/NMAKEmakefile
===================================================================
--- trunk/srclib/zlib/NMAKEmakefile 2008-04-02 12:41:26 UTC (rev 1498)
+++ trunk/srclib/zlib/NMAKEmakefile 2008-04-02 12:44:26 UTC (rev 1499)
@@ -46,6 +46,7 @@
!include <..\..\NMAKEcommon.inc>
+LFLAGS = $(LFLAGS) /version:1.3
INCLUDES = -I$(SRCDIR)
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
OBJECTS = \
16 years, 5 months
JBoss Native SVN: r1498 - trunk/httpd/httpd-2.2.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:41:26 -0400 (Wed, 02 Apr 2008)
New Revision: 1498
Modified:
trunk/httpd/httpd-2.2/NMAKEhttpd.inc
Log:
Add linker version 2.2 for all generated binaries
Modified: trunk/httpd/httpd-2.2/NMAKEhttpd.inc
===================================================================
--- trunk/httpd/httpd-2.2/NMAKEhttpd.inc 2008-04-02 12:39:52 UTC (rev 1497)
+++ trunk/httpd/httpd-2.2/NMAKEhttpd.inc 2008-04-02 12:41:26 UTC (rev 1498)
@@ -46,6 +46,7 @@
LIBZLIB = libzlib-1.lib
LIBHTTPD = libhttpd.lib
+LFLAGS = $(LFLAGS) /version:2.2
DISTSUBDIRS = \
$(PREFIX)\include\arch\win32\~ \
$(PREFIX)\lib\~ \
16 years, 5 months
JBoss Native SVN: r1497 - in trunk/build/install: xtool and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:39:52 -0400 (Wed, 02 Apr 2008)
New Revision: 1497
Modified:
trunk/build/install/installer/NMAKEmakefile
trunk/build/install/xtool/NMAKEmakefile
Log:
Add linker version info
Modified: trunk/build/install/installer/NMAKEmakefile
===================================================================
--- trunk/build/install/installer/NMAKEmakefile 2008-04-02 12:38:55 UTC (rev 1496)
+++ trunk/build/install/installer/NMAKEmakefile 2008-04-02 12:39:52 UTC (rev 1497)
@@ -33,6 +33,7 @@
CFLAGS = $(CFLAGS) -DSFX -DASM_CRC -DMAIN=MAIN -DNO_ZIPINFO=1
+LFLAGS = $(LFLAGS) /version:1.0
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib
LFLAGS = $(LFLAGS) shlwapi.lib netapi32.lib shell32.lib ole32.lib urlmon.lib
LFLAGS = $(LFLAGS) oleaut32.lib psapi.lib
Modified: trunk/build/install/xtool/NMAKEmakefile
===================================================================
--- trunk/build/install/xtool/NMAKEmakefile 2008-04-02 12:38:55 UTC (rev 1496)
+++ trunk/build/install/xtool/NMAKEmakefile 2008-04-02 12:39:52 UTC (rev 1497)
@@ -29,6 +29,7 @@
SRCDIR = .
!ENDIF
+LFLAGS = $(LFLAGS) /version:1.0
LFLAGS = $(LFLAGS) user32.lib shell32.lib advapi32.lib psapi.lib imagehlp.lib version.lib
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
16 years, 5 months
JBoss Native SVN: r1496 - in trunk/utils/windows/native/service: jbosssvc and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:38:55 -0400 (Wed, 02 Apr 2008)
New Revision: 1496
Modified:
trunk/utils/windows/native/service/jbosssch/NMAKEmakefile
trunk/utils/windows/native/service/jbosssvc/NMAKEmakefile
trunk/utils/windows/native/service/procrun/NMAKEmgr
trunk/utils/windows/native/service/procrun/NMAKEsvc
Log:
Add linker version info
Modified: trunk/utils/windows/native/service/jbosssch/NMAKEmakefile
===================================================================
--- trunk/utils/windows/native/service/jbosssch/NMAKEmakefile 2008-04-02 12:31:16 UTC (rev 1495)
+++ trunk/utils/windows/native/service/jbosssch/NMAKEmakefile 2008-04-02 12:38:55 UTC (rev 1496)
@@ -29,6 +29,7 @@
SRCDIR = .
!ENDIF
+LFLAGS = $(LFLAGS) /version:1.0
LFLAGS = $(LFLAGS) user32.lib
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
Modified: trunk/utils/windows/native/service/jbosssvc/NMAKEmakefile
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/NMAKEmakefile 2008-04-02 12:31:16 UTC (rev 1495)
+++ trunk/utils/windows/native/service/jbosssvc/NMAKEmakefile 2008-04-02 12:38:55 UTC (rev 1496)
@@ -29,6 +29,7 @@
SRCDIR = .
!ENDIF
+LFLAGS = $(LFLAGS) /version:1.0
LFLAGS = $(LFLAGS) user32.lib
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
Modified: trunk/utils/windows/native/service/procrun/NMAKEmgr
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEmgr 2008-04-02 12:31:16 UTC (rev 1495)
+++ trunk/utils/windows/native/service/procrun/NMAKEmgr 2008-04-02 12:38:55 UTC (rev 1496)
@@ -29,6 +29,7 @@
SRCDIR = .
!ENDIF
+LFLAGS = $(LFLAGS) /version:2.0
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src -I$(SRCDIR)\apps\prunmgr -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
Modified: trunk/utils/windows/native/service/procrun/NMAKEsvc
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEsvc 2008-04-02 12:31:16 UTC (rev 1495)
+++ trunk/utils/windows/native/service/procrun/NMAKEsvc 2008-04-02 12:38:55 UTC (rev 1496)
@@ -33,6 +33,7 @@
LFLAGS = $(LFLAGS) /stack:0x50000
!ENDIF
+LFLAGS = $(LFLAGS) /version:2.0
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src -I$(SRCDIR)\apps\prunsrv -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
16 years, 5 months
JBoss Native SVN: r1495 - trunk/utils/windows/native/service/procrun.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:31:16 -0400 (Wed, 02 Apr 2008)
New Revision: 1495
Modified:
trunk/utils/windows/native/service/procrun/NMAKEcommon.inc
trunk/utils/windows/native/service/procrun/NMAKEsvc
Log:
Use proper stack size
Modified: trunk/utils/windows/native/service/procrun/NMAKEcommon.inc
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEcommon.inc 2008-04-02 12:19:00 UTC (rev 1494)
+++ trunk/utils/windows/native/service/procrun/NMAKEcommon.inc 2008-04-02 12:31:16 UTC (rev 1495)
@@ -20,12 +20,12 @@
# and linker parameters.
# Common params:
# CPU Compile for specified CPU. Supported CPU's are:
-# i386
-# AMD64
-# IA64
+# X86 (Common x86 architecture)
+# X64 (AMD64/EMT64 architecture)
+# I64 (Intel IA64 architecture)
# If not specified it will default to the
# PROCESSOR_ARCHITECTURE environment variable
-# or to the i386 if not specified.
+# or to the X86 if not specified.
# WINVER Compile for specified Windows version
# WINNT for Windows 2000 and up(default)
# WINXP for Windows XP and up
@@ -50,6 +50,13 @@
# LFLAGS Added to the common LFLAGS
# RCFLAGS Added to the common RCFLAGS
#
+# Compiler tools environment variables:
+# CC C compiler (defaults to cl.exe)
+# LINK Linker (defaults to link.exe)
+# RC Resource compiler (defaults to rc.exe)
+# MT Manifest toolkit (defaults to mt.exe)
+# ML Assembler (defaults to ml.exe or ml64.exe)
+#
# Originally contributed by Mladen Turk <mturk jboss.com>
#
# ====================================================================
@@ -85,12 +92,17 @@
!IF !DEFINED(CPU) || "$(CPU)" == ""
!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+!IF "$(PROCESSOR_ARCHITEW6432)" == ""
CPU=X86
!ELSE
+CPU=$(PROCESSOR_ARCHITEW6432)
+!ENDIF
+!ELSE
CPU=$(PROCESSOR_ARCHITECTURE)
!ENDIF
!ENDIF
+
!IF "$(CPU)" == "I386"
CPU=X86
!ENDIF
@@ -193,6 +205,9 @@
# Common flags for all platforms
CMN_CFLAGS = -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT) -W3
+!IF "$(TARGET)" == "EXE"
+CMN_CFLAGS = $(CMN_CFLAGS) -D_CONSOLE
+!ENDIF
!IF "$(CPU)" == "X86"
CPU_CFLAGS = -D_X86_=1
Modified: trunk/utils/windows/native/service/procrun/NMAKEsvc
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEsvc 2008-04-02 12:19:00 UTC (rev 1494)
+++ trunk/utils/windows/native/service/procrun/NMAKEsvc 2008-04-02 12:31:16 UTC (rev 1495)
@@ -29,6 +29,10 @@
SRCDIR = .
!ENDIF
+!IF "$(CPU)" == "X86"
+LFLAGS = $(LFLAGS) /stack:0x50000
+!ENDIF
+
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src -I$(SRCDIR)\apps\prunsrv -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
16 years, 5 months
JBoss Native SVN: r1494 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-02 08:19:00 -0400 (Wed, 02 Apr 2008)
New Revision: 1494
Modified:
trunk/build/install/xtool/NMAKEmakefile
trunk/build/install/xtool/xtool.c
Log:
Added image tool for figuring out the PE info
Modified: trunk/build/install/xtool/NMAKEmakefile
===================================================================
--- trunk/build/install/xtool/NMAKEmakefile 2008-04-01 18:39:17 UTC (rev 1493)
+++ trunk/build/install/xtool/NMAKEmakefile 2008-04-02 12:19:00 UTC (rev 1494)
@@ -29,7 +29,7 @@
SRCDIR = .
!ENDIF
-LFLAGS = $(LFLAGS) user32.lib shell32.lib advapi32.lib psapi.lib
+LFLAGS = $(LFLAGS) user32.lib shell32.lib advapi32.lib psapi.lib imagehlp.lib version.lib
PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
OBJECTS = \
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-01 18:39:17 UTC (rev 1493)
+++ trunk/build/install/xtool/xtool.c 2008-04-02 12:19:00 UTC (rev 1494)
@@ -57,6 +57,7 @@
#include <shellapi.h>
#include <psapi.h>
#include <shlobj.h>
+#include <imagehlp.h>
#include <stdio.h>
#include <stdlib.h>
@@ -107,7 +108,10 @@
#define x_isalpha(c) (isalpha(((unsigned char)(c))))
#define x_isdigit(c) (isdigit(((unsigned char)(c))))
#define x_isspace(c) (isspace(((unsigned char)(c))))
+#define x_tolower(c) (tolower(((unsigned char)(c))))
+#define x_toupper(c) (toupper(((unsigned char)(c))))
+
typedef enum {
SYSDLL_KERNEL32 = 0, // kernel32 From WinBase.h
SYSDLL_NTDLL = 1, // ntdll From our real kernel
@@ -154,6 +158,7 @@
static SYSTEM_INFO win_osinf;
static OSVERSIONINFOEXA win_osver;
static int verbose = 0;
+static int xquiet = 0;
/*
* ---------------------------------------------------------------------
@@ -260,7 +265,7 @@
0
};
-int x_cerror(int err)
+static int x_cerror(int err)
{
if (err == 0) {
if ((err = GetLastError()) == 0)
@@ -285,6 +290,17 @@
return c_errno_table[err];
}
+static int x_perror(int err, const char *msg)
+{
+ if (err == 0)
+ err = x_cerror(errno);
+ if (!xquiet) {
+ errno = err;
+ perror(msg);
+ }
+ return err;
+}
+
static void x_free(void *p)
{
if (p != NULL) {
@@ -296,8 +312,7 @@
{
void *p = calloc(1, size);
if (p == NULL) {
- perror("malloc");
- _exit(ENOMEM);
+ _exit(x_perror(ENOMEM, "malloc"));
}
return p;
}
@@ -306,8 +321,7 @@
{
void *p = calloc(1, size);
if (p == NULL) {
- perror("calloc");
- _exit(ENOMEM);
+ _exit(x_perror(ENOMEM, "calloc"));
}
return p;
}
@@ -316,8 +330,7 @@
{
m = realloc(m, size);
if (m == NULL) {
- perror("realloc");
- _exit(ENOMEM);
+ _exit(x_perror(ENOMEM, "realloc"));
}
return m;
}
@@ -524,6 +537,22 @@
return x_strdup(add);
}
+static char *x_strchr(const char *p, int ch, int icase)
+{
+ char c;
+
+ c = ch;
+ for (;; ++p) {
+ if (icase && (x_tolower(*p) == x_tolower(c)))
+ return (char *)p;
+ else if (*p == c)
+ return (char *)p;
+ if (*p == '\0')
+ return NULL;
+ }
+ /* NOTREACHED */
+}
+
static char *__argv0 = NULL;
static char *__pname = NULL;
static char *__ppath = NULL;
@@ -640,7 +669,7 @@
}
else if (exp[y] != '?') {
if (icase) {
- if (tolower((unsigned char)str[x]) != tolower((unsigned char)exp[y]))
+ if (x_tolower(str[x]) != x_tolower(exp[y]))
return 1;
}
else if (str[x] != exp[y])
@@ -986,7 +1015,7 @@
*ptr = '\0';
if (name[1] == ':') {
char *rv = x_strdup(name);
- *rv = toupper((unsigned char)*rv);
+ *rv = x_toupper(*rv);
return rv;
}
}
@@ -1098,7 +1127,7 @@
while (*string) {
if (icase)
- i = toupper(*string);
+ i = x_toupper(*string);
else
i = *string;
hash = hash * 33 + i;
@@ -1287,6 +1316,8 @@
static void vwarnx(const char *fmt, va_list ap)
{
+ if (xquiet)
+ return;
fprintf(stderr, "%s: ", getprogname());
if (fmt != NULL)
vfprintf(stderr, fmt, ap);
@@ -1320,7 +1351,7 @@
* Parse argc/argv argument vector.
* However this one allows both - and / as argument options
*/
-int getopt(int nargc, const char **nargv, const char *ostr)
+int getopt(int nargc, const char **nargv, const char *ostr, int icase)
{
static const char *place = EMSG; /* option letter processing */
char *oli = NULL; /* option letter list index */
@@ -1374,7 +1405,7 @@
* if the program (eg su) is looking for it.
*/
place = EMSG;
- if (strchr(ostr, first) == NULL)
+ if (x_strchr(ostr, first, icase) == NULL)
return EOF;
optopt = first;
}
@@ -1389,7 +1420,7 @@
optopt = *place++;
/* See if option letter is one the caller wanted... */
- if (optopt == BADARG || (oli = strchr(ostr, optopt)) == NULL) {
+ if (optopt == BADARG || (oli = x_strchr(ostr, optopt, icase)) == NULL) {
if (!optsbrk && optslash == '/' && first == optslash) {
/* Non option starting with / */
place = EMSG;
@@ -2194,7 +2225,7 @@
{
int ch;
- while ((ch = getopt(argc, argv, "s:V:g:r:qLRS-")) != EOF) {
+ while ((ch = getopt(argc, argv, "s:V:g:r:qLRS-", 0)) != EOF) {
printf("Valid argument = %c [%s]\n", ch, optarg);
}
argc -= optind;
@@ -2295,6 +2326,14 @@
}
}
+static void print_stdusage()
+{
+ fprintf(stderr, " -q Be quiet.\n");
+ fprintf(stderr, " -v --verbose Explain what is being done.\n");
+ fprintf(stderr, " --version Output version information and exit.\n");
+ fprintf(stderr, " -h --help Display this help and exit.\n\n");
+}
+
/*
* ---------------------------------------------------------------------
* end of user interface
@@ -2312,9 +2351,7 @@
fprintf(stderr, "Usage: %s [OPTION]... DIRECTORY...\n", progname);
fprintf(stderr, "Create the DIRECTORY(ies), if they do not already exist.\n");
fprintf(stderr, "Any intermediate directories in the path are created, if needed\n\n");
- fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
- fprintf(stderr, " --version output version information and exit.\n");
- fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ print_stdusage();
return retval;
}
@@ -2322,10 +2359,8 @@
{
fprintf(stderr, "Usage: %s [OPTION]... DIRECTORY...\n", progname);
fprintf(stderr, "Remove (unlink) the DIRECTORY(ies).\n\n");
- fprintf(stderr, " -r, -R, remove the contents of directories recursively.\n\n");
- fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
- fprintf(stderr, " --version output version information and exit.\n");
- fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ fprintf(stderr, " -r remove the contents of directories recursively.\n\n");
+ print_stdusage();
return retval;
}
@@ -2333,15 +2368,13 @@
{
fprintf(stderr, "Usage: %s [OPTION]... FILE...\n", progname);
fprintf(stderr, "Update the access and modification times of each FILE to the current time\n\n");
- fprintf(stderr, " -a, -A, change only the access time.\n");
- fprintf(stderr, " -c, -C, do not create any files.\n");
- fprintf(stderr, " -d, -D, STRING parse STRING and use it instead of current time.\n");
- fprintf(stderr, " -m, -M, change only the modification time.\n");
- fprintf(stderr, " -r, -R, FILE use this file time's instead current time.\n");
- fprintf(stderr, " -t, -T, STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time.\n\n");
- fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
- fprintf(stderr, " --version output version information and exit.\n");
- fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ fprintf(stderr, " -a change only the access time.\n");
+ fprintf(stderr, " -c do not create any files.\n");
+ fprintf(stderr, " -d STRING parse STRING and use it instead of current time.\n");
+ fprintf(stderr, " -m change only the modification time.\n");
+ fprintf(stderr, " -r FILE use this file time's instead current time.\n");
+ fprintf(stderr, " -t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time.\n\n");
+ print_stdusage();
return retval;
}
@@ -2349,30 +2382,51 @@
{
fprintf(stderr, "Usage: %s [OPTION]... program [ARGUMENTS]\n", progname);
fprintf(stderr, "Execute program.\n\n");
- fprintf(stderr, " -c, -C, Replace cygwin paths.\n");
- fprintf(stderr, " -s, -S, Replace SUA paths.\n");
- fprintf(stderr, " -r, -R, Replace relative paths.\n");
- fprintf(stderr, " -e, -E, Keep existing environment.\n");
- fprintf(stderr, " -f, -F, Use forward slashes.\n\n");
- fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
- fprintf(stderr, " --version output version information and exit.\n");
- fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ fprintf(stderr, " -c Replace cygwin paths.\n");
+ fprintf(stderr, " -s Replace SUA paths.\n");
+ fprintf(stderr, " -r Replace relative paths.\n");
+ fprintf(stderr, " -e Keep existing environment.\n");
+ fprintf(stderr, " -f Use forward slashes.\n\n");
+ print_stdusage();
return retval;
}
static int prog_mktemp_usage(int retval)
{
fprintf(stderr, "Usage: %s [OPTION]... [TEMPLATE]\n", progname);
- fprintf(stderr, "Execute program.\n\n");
- fprintf(stderr, " -d, -D, Make a directory instead file.\n");
- fprintf(stderr, " -q, -Q, Be quiet.\n");
- fprintf(stderr, " -u, -U, Unlink file or directory befor exiting.\n\n");
- fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
- fprintf(stderr, " --version output version information and exit.\n");
- fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ fprintf(stderr, "Make temporary file (unique).\n\n");
+ fprintf(stderr, " -d Make a directory instead file.\n");
+ fprintf(stderr, " -u Unlink file or directory befor exiting.\n\n");
+ print_stdusage();
return retval;
}
+static int prog_image_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... FILE...\n", progname);
+ fprintf(stderr, "Get information about PE image\n\n");
+ fprintf(stderr, " -a Print all information.\n");
+ fprintf(stderr, " -l Print long information.\n");
+ fprintf(stderr, " -c Characteristcs (numeric).\n");
+ fprintf(stderr, " -C Characteristcs (described).\n");
+ fprintf(stderr, " -d Provided file is DLL.\n");
+ fprintf(stderr, " -m Architecture type of the image\n");
+ fprintf(stderr, " -t Date and time the image was created by the linker\n");
+ fprintf(stderr, " -T Strftime format for -t\n");
+ fprintf(stderr, " -s Subsystem required to run this image\n");
+ fprintf(stderr, " -S Number of bytes to commit for the stack\n");
+ fprintf(stderr, " -b Preferred address of the image when it is loaded in memory.\n");
+ fprintf(stderr, " -L Linker version used.\n");
+ fprintf(stderr, " -o Required operating system.\n");
+ fprintf(stderr, " -i Version number of the image.\n");
+ fprintf(stderr, " -f File Version (64-Bit number).\n");
+ fprintf(stderr, " -F File Version (from Resource).\n");
+ fprintf(stderr, " -p Product Version (64-Bit number).\n");
+ fprintf(stderr, " -P Product Version (from Resource).\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -2390,30 +2444,30 @@
int i, ch, rv = 0;
verbose = 0;
- x_free(__pname);
- __pname = "mkdir";
- while ((ch = getopt(argc, argv, "hHvV")) != EOF) {
+ while ((ch = getopt(argc, argv, "hqv", 1)) != EOF) {
switch (ch) {
case '.':
- if (!strcmp(optarg, "verbose"))
+ if (!stricmp(optarg, "verbose"))
verbose = 1;
- else if (!strcmp(optarg, "version"))
+ else if (!stricmp(optarg, "version"))
return print_banner(1);
- else if (!strcmp(optarg, "help"))
+ else if (!stricmp(optarg, "help"))
return prog_mkdir_usage(0);
else
return prog_mkdir_usage(EINVAL);
break;
case 'v':
- case 'V':
verbose = 1;
break;
+ case 'q':
+ xquiet = 1;
+ break;
case 'h':
- case 'H':
return prog_mkdir_usage(0);
break;
case '?':
+ case ':':
return EINVAL;
break;
}
@@ -2436,33 +2490,32 @@
int i, ch, rv = 0;
int recurse = 0;
- x_free(__pname);
- __pname = "rmdir";
- while ((ch = getopt(argc, argv, "hHvVrR")) != EOF) {
+ while ((ch = getopt(argc, argv, "rhqv", 1)) != EOF) {
switch (ch) {
case '.':
- if (!strcmp(optarg, "verbose"))
+ if (!stricmp(optarg, "verbose"))
verbose = 1;
- else if (!strcmp(optarg, "version"))
+ else if (!stricmp(optarg, "version"))
return print_banner(1);
- else if (!strcmp(optarg, "help"))
+ else if (!stricmp(optarg, "help"))
return prog_rmdir_usage(0);
else
return prog_rmdir_usage(EINVAL);
break;
case 'v':
- case 'V':
verbose = 1;
break;
+ case 'q':
+ xquiet = 1;
+ break;
case 'h':
- case 'H':
return prog_rmdir_usage(0);
break;
case 'r':
- case 'R':
recurse = 1;
break;
case '?':
+ case ':':
return EINVAL;
break;
}
@@ -2496,52 +2549,46 @@
wchar_t file[X_MAX_PATH];
WIN32_FILE_ATTRIBUTE_DATA ad;
- x_free(__pname);
- __pname = "touch";
- while ((ch = getopt(argc, argv, "aAcCfFmMr:R:t:hHvV")) != EOF) {
+ while ((ch = getopt(argc, argv, "acfmr:t:hqv", 1)) != EOF) {
switch (ch) {
case '.':
- if (!strcmp(optarg, "verbose"))
+ if (!stricmp(optarg, "verbose"))
verbose = 1;
- else if (!strcmp(optarg, "version"))
+ else if (!stricmp(optarg, "version"))
return print_banner(1);
- else if (!strcmp(optarg, "help"))
+ else if (!stricmp(optarg, "help"))
return prog_touch_usage(0);
else
return prog_touch_usage(EINVAL);
break;
case 'v':
- case 'V':
verbose = 1;
break;
+ case 'q':
+ xquiet = 1;
+ break;
case 'h':
- case 'H':
return prog_touch_usage(0);
break;
case 'f':
- case 'F':
force = 1;
case 'c':
- case 'C':
create = OPEN_EXISTING;
break;
case 'a':
- case 'A':
flags |= 1;
break;
case 'm':
- case 'M':
flags |= 2;
break;
case 'r':
- case 'R':
from = optarg;
break;
case 't':
- case 'T':
tstr = optarg;
break;
case '?':
+ case ':':
return EINVAL;
break;
}
@@ -2697,50 +2744,45 @@
char **mainargv = NULL;
char wcpath[MAX_PATH + 32] = { 0 };
- x_free(__pname);
- __pname = "exec";
- while ((ch = getopt(argc, argv, "cCeEfFrRsShHvV")) != EOF) {
+ while ((ch = getopt(argc, argv, "cefrshqv", 1)) != EOF) {
switch (ch) {
case '.':
- if (!strcmp(optarg, "verbose"))
+ if (!stricmp(optarg, "verbose"))
verbose = 1;
- else if (!strcmp(optarg, "version"))
+ else if (!stricmp(optarg, "version"))
return print_banner(1);
- else if (!strcmp(optarg, "help"))
+ else if (!stricmp(optarg, "help"))
return prog_exec_usage(0);
else
return prog_exec_usage(EINVAL);
break;
case 'v':
- case 'V':
verbose = 1;
break;
+ case 'q':
+ xquiet = 1;
+ break;
case 'h':
- case 'H':
return prog_exec_usage(0);
break;
case 'c':
- case 'C':
cygwin = 1;
break;
case 's':
- case 'S':
suawin = 1;
break;
case 'e':
- case 'E':
keepenv = 1;
break;
case 'r':
- case 'R':
relpath = 1;
break;
case 'f':
- case 'F':
back = 0;
windrive[2] = '/';
break;
case '?':
+ case ':':
return EINVAL;
break;
}
@@ -2758,8 +2800,7 @@
/* TODO: Figure out the paths from
* the registry
*/
- rv = errno = ENOENT;
- perror("JAVA_HOME environment");
+ rv = x_perror(ENOENT, "JAVA_HOME environment");
goto cleanup;
}
strcpy(wcpath, jhome);
@@ -2773,8 +2814,7 @@
!stricmp(argv[0], "lib") ||
!stricmp(argv[0], "link")) {
if (!getmsvcpath()) {
- rv = errno = ENOENT;
- perror("Microsoft compiler");
+ rv = x_perror(ENOENT, "Microsoft compiler");
goto cleanup;
}
strcpy(wcpath, getmsvcpath());
@@ -2790,15 +2830,13 @@
if (cygwin) {
if (!(posixroot = getcygdrive(&drive, back))) {
- rv = errno = ENOENT;
- perror("Cygwing drive");
+ rv = x_perror(ENOENT, "Cygwing drive");
goto cleanup;
}
}
else if (suawin) {
if (!(posixroot = getsuadrive(&drive, back))) {
- rv = errno = ENOENT;
- perror("Posix drive");
+ rv = x_perror(ENOENT, "Posix drive");
goto cleanup;
}
}
@@ -2844,8 +2882,7 @@
fprintf(stdout, "%s: exit(%d)\n", mainargv[0], rv);
}
else {
- rv = errno = ENOENT;
- perror(mainargv[0]);
+ rv = x_perror(ENOENT, mainargv[0]);
}
cleanup:
@@ -2864,48 +2901,41 @@
{
int ch, rv = 0;
char path[MAX_PATH] = { 0 };
- int silent = 0;
int mdir = 0;
int unsafe = 0;
int randnum;
char patern[MAX_PATH];
register char *start, *trv, *suffp;
- x_free(__pname);
- __pname = "mktemp";
- while ((ch = getopt(argc, argv, "dDqQhHuUvV")) != EOF) {
+ while ((ch = getopt(argc, argv, "dquhqv", 1)) != EOF) {
switch (ch) {
case '.':
- if (!strcmp(optarg, "verbose"))
+ if (!stricmp(optarg, "verbose"))
verbose = 1;
- else if (!strcmp(optarg, "version"))
+ else if (!stricmp(optarg, "version"))
return print_banner(1);
- else if (!strcmp(optarg, "help"))
+ else if (!stricmp(optarg, "help"))
return prog_mktemp_usage(0);
else
return prog_mktemp_usage(1);
break;
case 'v':
- case 'V':
verbose = 1;
break;
+ case 'q':
+ xquiet = 1;
+ break;
case 'h':
- case 'H':
return prog_mktemp_usage(0);
break;
case 'd':
- case 'D':
mdir = 1;
break;
- case 'q':
- case 'Q':
- silent = 1;
- break;
case 'u':
- case 'U':
unsafe = 1;
break;
case '?':
+ case ':':
return 1;
break;
}
@@ -2918,22 +2948,17 @@
strcpy(patern, "tmp.XXXXXXXX");
if (GetTempPathA(MAX_PATH - strlen(patern) - 1, path) == 0) {
- if (!silent)
- perror("Temp Path");
+ x_perror(0, "Temp Path");
return 1;
}
strcat(path, patern);
x_backslash(path);
- printf("Temp base %s\n", path);
for (trv = path; *trv; ++trv)
;
suffp = trv;
--trv;
if (trv < path) {
- if (!silent) {
- errno = EINVAL;
- perror("Temp Path");
- }
+ x_perror(EINVAL, "Temp Path");
return 1;
}
@@ -2953,8 +2978,7 @@
if (errno == ENOENT) {
if (mdir) {
if (mkdir(path)) {
- if (!silent)
- perror(path);
+ x_perror(0, path);
return 1;
}
if (unsafe)
@@ -2963,8 +2987,7 @@
else {
FILE *fp = fopen(path, "w");
if (!fp) {
- if (!silent)
- perror(path);
+ x_perror(0, path);
return 1;
}
fclose(fp);
@@ -2979,10 +3002,7 @@
for (trv = start;;) {
char *pad;
if (*trv == '\0' || trv == suffp) {
- if (!silent) {
- errno = EINVAL;
- perror("Temp Path");
- }
+ x_perror(ENOENT, "Temp Path");
return 1;
}
pad = strchr((char *)padchar, *trv);
@@ -2999,12 +3019,558 @@
return rv;
}
+ struct Var {
+ WORD wLength;
+ WORD wValueLength;
+ WORD wType;
+ WCHAR szKey[1];
+ };
+
+static char *qresinfo(void *data, DWORD lang, const char *info)
+{
+ ULONG u;
+ void *rv;
+ char buff[1024];
+
+ if (lang) {
+ sprintf(buff, "\\StringFileInfo\\%02X%02X%02X%02X\\%s",
+ (lang & 0x0000ff00) >> 8,
+ (lang & 0x000000ff),
+ (lang & 0xff000000) >> 24,
+ (lang & 0x00ff0000) >> 16,
+ info);
+ }
+ else {
+ sprintf(buff, "\\StringFileInfo\\%04X04B0\\%s",
+ GetUserDefaultLangID(),
+ info);
+ }
+ if (VerQueryValueA(data, buff, &rv, &u))
+ return (char *)rv;
+ else
+ return 0;
+}
+
+
+static int prog_image(int argc, const char **argv, const char **env)
+{
+ int i, ch, rv = 0;
+ char *dllpath = NULL;
+ int prall = 0;
+ BOOL dotdll = FALSE;
+ LOADED_IMAGE img;
+ DWORD infosiz = 0;
+ void *pidata = NULL;
+ VS_FIXEDFILEINFO *fvi = NULL;
+
+ int lcnt = 0;
+ int pname = 0;
+ int plong = 0;
+ int pmachine = 0;
+ int ptime = 0;
+ int pnchar = 0;
+ int pschar = 0;
+ int psubsys = 0;
+ int pstack = 0;
+ int posver = 0;
+ int pimgver = 0;
+ int pbase = 0;
+ int plinker = 0;
+ int pnfver = 0;
+ int pnfveri = 0;
+ int pnpver = 0;
+ int pnpveri = 0;
+ char *tfmt = NULL;
+
+ while ((ch = getopt(argc, argv, "aAbBcCdDiIlLmMnNoOpPfFsStT:hHqQvV", 0)) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!stricmp(optarg, "verbose"))
+ verbose = 1;
+ else if (!stricmp(optarg, "version"))
+ return print_banner(1);
+ else if (!stricmp(optarg, "help"))
+ return prog_mktemp_usage(0);
+ else if (!stricmp(optarg, "path"))
+ dllpath = x_strdup(optarg);
+ else
+ return prog_image_usage(1);
+ break;
+ case 'v':
+ case 'V':
+ verbose = 1;
+ break;
+ case 'q':
+ case 'Q':
+ xquiet = 1;
+ break;
+ case 'h':
+ case 'H':
+ return prog_image_usage(0);
+ break;
+ case 'a':
+ case 'A':
+ prall = 1;
+ pname = 1;
+ pmachine = 1;
+ ptime = 1;
+ pnchar = 1;
+ psubsys = 1;
+ pstack = 1;
+ pbase = 1;
+ pimgver = 1;
+ posver = 1;
+ plinker = 1;
+ pnpver = 1;
+ pnfver = 1;
+ pnpveri = 1;
+ pnfveri = 1;
+ break;
+ case 'b':
+ case 'B':
+ pbase = 1;
+ break;
+ case 'i':
+ case 'I':
+ pimgver = 1;
+ break;
+ case 'l':
+ plong = 1;
+ case 'L':
+ plinker = 1;
+ break;
+ case 'm':
+ case 'M':
+ pmachine = 1;
+ break;
+ case 'n':
+ case 'N':
+ pname = 1;
+ break;
+ case 'T':
+ tfmt = x_strdup(optarg);
+ case 't':
+ ptime = 1;
+ break;
+ case 'c':
+ pnchar = 1;
+ break;
+ case 'C':
+ pschar = 1;
+ break;
+ case 'o':
+ case 'O':
+ posver = 1;
+ break;
+ case 's':
+ psubsys = 1;
+ break;
+ case 'S':
+ pstack = 1;
+ break;
+ case 'F':
+ pnfveri = 1;
+ case 'f':
+ pnfver = 1;
+ break;
+ case 'P':
+ pnpveri = 1;
+ case 'p':
+ pnpver = 1;
+ break;
+ case 'd':
+ case 'D':
+ dotdll = TRUE;
+ break;
+ case '?':
+ case ':':
+ return 1;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 1) {
+ return prog_image_usage(EINVAL);
+ }
+ for (i = 0; i < argc; i++) {
+ int lang = 0;
+ if (i) {
+ lcnt = 0;
+ fputc('\n', stdout);
+ }
+ if (!MapAndLoad((char *)argv[i], dllpath, &img, dotdll, TRUE)) {
+ return x_perror(0, argv[i]);
+ }
+ infosiz = GetFileVersionInfoSizeA(img.ModuleName, NULL);
+ if (infosiz) {
+ pidata = x_malloc(infosiz);
+ if (!GetFileVersionInfoA(img.ModuleName, 0,
+ infosiz, pidata)) {
+ rv = x_perror(0, img.ModuleName);
+ UnMapAndLoad(&img);
+ x_free(pidata);
+ return rv;
+ }
+ fvi = NULL;
+ if (pnpver || pnfver) {
+ UINT ul;
+ void *p;
+ if (!VerQueryValueA(pidata, "\\",
+ &fvi, &ul)) {
+ x_perror(0, img.ModuleName);
+ }
+ else {
+ if (fvi->dwSignature != 0xFEEF04BD)
+ fvi = NULL;
+ }
+ if (!VerQueryValueA(pidata, "\\VarFileInfo\\Translation",
+ &p, &ul)) {
+ x_perror(0, img.ModuleName);
+ }
+ else {
+ if (ul == 4)
+ memcpy(&lang, p, 4);
+ }
+ }
+ }
+ if (!pname && (pmachine + pstack + psubsys +
+ pnchar + pschar + posver + pimgver +
+ pbase + plinker + pnpver + pnfver) == 0)
+ pname = 1;
+ if (pname) {
+ fputs(img.ModuleName, stdout);
+ if (plong)
+ fputc('\n', stdout);
+ lcnt++;
+ }
+ if (pmachine) {
+ char machine[8] = { 0 };
+ switch (img.FileHeader->FileHeader.Machine) {
+ case IMAGE_FILE_MACHINE_I386:
+ strcpy(machine, "x86");
+ break;
+ case IMAGE_FILE_MACHINE_IA64:
+ strcpy(machine, "i64");
+ break;
+ case IMAGE_FILE_MACHINE_AMD64:
+ strcpy(machine, "x64");
+ break;
+ default:
+ sprintf(machine, "0x%04x",
+ img.FileHeader->FileHeader.Machine);
+ break;
+ }
+ if (plong) {
+ fputs("Machine: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ fputs(machine, stdout);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (ptime) {
+ char buff[64] = { 0 };
+ struct tm *lt;
+ time_t t = (time_t)img.FileHeader->FileHeader.TimeDateStamp;
+ lt = localtime(&t);
+ if (!tfmt)
+ tfmt = x_strdup("%Y-%m-%d %H:%M:%S");
+ if (!strftime(buff, 64, tfmt, lt)) {
+ rv = x_perror(errno, tfmt);
+ UnMapAndLoad(&img);
+ return rv;
+ }
+ if (plong) {
+ fputs("Linked: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ fputs(buff, stdout);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (psubsys) {
+ if (plong) {
+ fputs("Subsystem: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ switch (img.FileHeader->OptionalHeader.Subsystem) {
+ case IMAGE_SUBSYSTEM_UNKNOWN:
+ fputs("unknown", stdout);
+ break;
+ case IMAGE_SUBSYSTEM_NATIVE:
+ fputs("native", stdout);
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_GUI:
+ fputs("gui", stdout);
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_CUI:
+ fputs("console", stdout);
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI:
+ fputs("ce", stdout);
+ break;
+ case IMAGE_SUBSYSTEM_POSIX_CUI:
+ fputs("posix", stdout);
+ break;
+ case 16:
+ fputs("boot", stdout);
+ break;
+ default:
+ fprintf(stdout, "%d",
+ img.FileHeader->OptionalHeader.Subsystem);
+ break;
+ }
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (pstack) {
+ if (plong) {
+ fputs("Stack: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+#ifdef _WIN64
+ fprintf(stdout, "%I64d",
+#else
+ fprintf(stdout, "%d",
+#endif
+ img.FileHeader->OptionalHeader.SizeOfStackReserve);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (posver) {
+ if (plong) {
+ fputs("OperatingSystem: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ fprintf(stdout, "%d.%d",
+ img.FileHeader->OptionalHeader.MajorOperatingSystemVersion,
+ img.FileHeader->OptionalHeader.MinorOperatingSystemVersion);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (pimgver && fvi) {
+ if (plong) {
+ fputs("ImageVersion: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ fprintf(stdout, "%d.%d",
+ img.FileHeader->OptionalHeader.MajorImageVersion,
+ img.FileHeader->OptionalHeader.MinorImageVersion);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (pnfver && fvi) {
+ LARGE_INTEGER li;
+ char *p;
+ if (plong) {
+ fputs("FileVersion: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ li.HighPart = fvi->dwFileVersionMS;
+ li.LowPart = fvi->dwFileVersionLS;
+ if (pnfveri && (p = qresinfo(pidata, lang, "FileVersion"))) {
+ fputs(p, stdout);
+ }
+ else
+ fprintf(stdout, "%I64d", li.QuadPart);
+ if (plong)
+ fputc('\n', stdout);
+ }
+
+ if (pnpver && fvi) {
+ LARGE_INTEGER li;
+ char *p;
+ if (plong) {
+ fputs("ProductVersion: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ li.HighPart = fvi->dwProductVersionMS;
+ li.LowPart = fvi->dwProductVersionLS;
+ if (pnpveri && (p = qresinfo(pidata, lang, "ProductVersion"))) {
+ fputs(p, stdout);
+ }
+ else
+ fprintf(stdout, "%I64d", li.QuadPart);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (plinker) {
+ if (plong) {
+ fputs("LinkerVersion: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ fprintf(stdout, "%d.%d",
+ img.FileHeader->OptionalHeader.MajorLinkerVersion,
+ img.FileHeader->OptionalHeader.MinorLinkerVersion);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (pbase) {
+ if (plong) {
+ fputs("ImageBase: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+#ifdef _WIN64
+ fprintf(stdout, "0x%016I64x",
+#else
+ fprintf(stdout, "0x%08x",
+#endif
+ img.FileHeader->OptionalHeader.ImageBase);
+ if (plong)
+ fputc('\n', stdout);
+ }
+ if (pnchar || pschar) {
+ if (plong) {
+ fputs("Characteristics: ", stdout);
+ }
+ else {
+ if (lcnt++)
+ fputc('\t', stdout);
+ }
+ if (pnchar) {
+ fprintf(stdout, "0x%04x",
+ img.FileHeader->FileHeader.Characteristics);
+ if (pschar)
+ fputs(" (", stdout);
+ }
+ if (pschar) {
+ int cc = 0;
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_RELOCS_STRIPPED) {
+ fputs("reloc-stripped", stdout);
+ cc++;
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_EXECUTABLE_IMAGE) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("executable", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_LINE_NUMS_STRIPPED) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("coff-lines-stripped", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_LOCAL_SYMS_STRIPPED) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("coff-symtable-stripped", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_LARGE_ADDRESS_AWARE) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("large-address", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_32BIT_MACHINE) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("32-bit", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("removable-swap", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_NET_RUN_FROM_SWAP) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("net-swap", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_DEBUG_STRIPPED) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("debug-stripped", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_SYSTEM) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("filesystem", stdout);
+ }
+ if (img.FileHeader->FileHeader.Characteristics &
+ IMAGE_FILE_DLL) {
+ if (cc++)
+ fputs(", ", stdout);
+ fputs("dll", stdout);
+ }
+ if (pnchar)
+ fputc(')', stdout);
+ }
+ if (plong)
+ fputc('\n', stdout);
+ }
+ UnMapAndLoad(&img);
+ x_free(pidata);
+ pidata = NULL;
+ }
+ if (verbose)
+ fputc('\n', stdout);
+ return 0;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
* ---------------------------------------------------------------------
*/
+typedef int (*pmain_t)(int, const char **, const char **);
+
+static struct x_program {
+ const char *name;
+ pmain_t pmain;
+} x_programs[] = {
+ { "mkdir", prog_mkdir },
+ { "md", prog_mkdir },
+ { "rmdir", prog_rmdir },
+ { "rd", prog_rmdir },
+ { "touch", prog_touch },
+ { "exec", prog_exec },
+ { "mktemp", prog_mktemp },
+ { "image", prog_image },
+ { "coff", prog_image },
+
+ { NULL, NULL }
+};
+
/*
* ---------------------------------------------------------------------
* utf-8 main. Arguments passed are utf-8 encoded
@@ -3012,44 +3578,42 @@
*/
static int umain(int argc, const char **argv, const char **env)
{
- const char *name = progname;
+ const char *name = progname;
+ struct x_program *p;
+
if (*name == 'x' || *name == 'X')
name++;
- if (!stricmp(name, "mkdir"))
- return prog_mkdir(argc, argv, env);
- else {
- if (argc < 2) {
- fprintf(stderr, "Usage: %s <command>\n",
- progname);
- return EINVAL;
+
+ p = &x_programs[0];
+ while (p->name) {
+ if (!stricmp(name, p->name)) {
+ x_free(__pname);
+ __pname = x_strdup(name);
+ return (*(p->pmain))(argc, argv, env);
}
- if (!stricmp(argv[1], "mkdir"))
- return prog_mkdir(--argc, ++argv, env);
- else if (!stricmp(argv[1], "rmdir"))
- return prog_rmdir(--argc, ++argv, env);
- else if (!stricmp(argv[1], "touch"))
- return prog_touch(--argc, ++argv, env);
- else if (!stricmp(argv[1], "exec"))
- return prog_exec(--argc, ++argv, env);
- else if (!stricmp(argv[1], "mktemp"))
- return prog_mktemp(--argc, ++argv, env);
- else if (!stricmp(argv[1], "test")) {
- argc -= 2;
- argv += 2;
- printf("Test %d %s\n", argc, *argv);
- if (argc && !strcmp(*argv, "ini"))
- return test_ini();
- if (argc && !strcmp(*argv, "path"))
- return test_path(--argc, ++argv, env);
+ p++;
+ }
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <command>\n",
+ progname);
+ print_programs();
+ return EINVAL;
+ }
+ --argc;
+ ++argv;
+ p = &x_programs[0];
+ while (p->name) {
+ if (!stricmp(argv[0], p->name)) {
+ x_free(__pname);
+ __pname = x_strdup(argv[0]);
+ return (*(p->pmain))(argc, argv, env);
}
- else {
- fprintf(stderr, "Usage: %s <command>\n",
- progname);
- print_programs();
- return EINVAL;
- }
+ p++;
}
- return 0;
+ fprintf(stderr, "Usage: %s <command>\n",
+ progname);
+ print_programs();
+ return EINVAL;
}
static void setup_env(const char **env)
16 years, 5 months
JBoss Native SVN: r1493 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-01 14:39:17 -0400 (Tue, 01 Apr 2008)
New Revision: 1493
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add mktemp and exec tools
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-01 14:03:40 UTC (rev 1492)
+++ trunk/build/install/xtool/xtool.c 2008-04-01 18:39:17 UTC (rev 1493)
@@ -88,7 +88,10 @@
#define DEFAULT_HASH_SIZE 256
/* Maximum size for environment expansion */
#define INFO_BUFFER_SIZE 32767
+/* This is used to cache lengths in x_strvcat */
+#define MAX_SAVED_LENGTHS 8
+
/*
* Alignment macros
*/
@@ -169,7 +172,7 @@
int utf8_to_unicode(wchar_t *, size_t, const char *);
int unicode_to_utf8(char *, size_t, const wchar_t* srcstr);
int x_wfullpath(wchar_t *, size_t, const char *);
-
+char *x_forwardslash(char *);
/*
* ---------------------------------------------------------------------
* end of forward declrations
@@ -291,7 +294,7 @@
static void *x_malloc(size_t size)
{
- void *p = malloc(size);
+ void *p = calloc(1, size);
if (p == NULL) {
perror("malloc");
_exit(ENOMEM);
@@ -319,6 +322,43 @@
return m;
}
+static char **a_alloc(size_t size)
+{
+ if (size)
+ return (char **)x_malloc((size + 1) * sizeof(char *));
+ else {
+ errno = EINVAL;
+ return NULL;
+ }
+}
+
+static void a_free(char **array)
+{
+ char **ptr = array;
+
+ if (!array)
+ return;
+ while (*ptr != NULL) {
+ x_free(*(ptr++));
+ }
+ x_free(array);
+}
+
+static size_t a_size(const char **array)
+{
+ const char **ptr = array;
+ if (array) {
+ size_t siz = 0;
+ while (*ptr != NULL) {
+ ptr++;
+ siz++;
+ }
+ return siz;
+ }
+ else
+ return 0;
+}
+
static char *x_strdup(const char *s)
{
char *p;
@@ -334,6 +374,19 @@
return p;
}
+static char *x_strndup(const char *s, size_t size)
+{
+ char *p;
+
+ if (s == NULL)
+ return NULL;
+ if (strlen(s) < size)
+ size = strlen(s);
+ p = (char *)x_malloc(size + 2);
+ memcpy(p, s, size);
+ return p;
+}
+
static wchar_t *x_wstrdup_utf8(const char *str)
{
int len;
@@ -407,29 +460,51 @@
static char *x_strvcat(const char *str, ...)
{
- char *dst = NULL;
- const char *ptr = str;
- size_t len = 0;
- va_list v;
- if (!str)
- return NULL;
- va_start(v, str);
- while (ptr) {
- len += strlen(ptr);
- ptr = va_arg(v, const char *);
+ char *cp, *argp, *res;
+ size_t saved_lengths[MAX_SAVED_LENGTHS];
+ int nargs = 0;
+
+ /* Pass one --- find length of required string */
+
+ size_t len = strlen(str);
+ va_list adummy;
+
+ va_start(adummy, str);
+ saved_lengths[nargs++] = len;
+ while ((cp = va_arg(adummy, char *)) != NULL) {
+ size_t cplen = strlen(cp);
+ if (nargs < MAX_SAVED_LENGTHS) {
+ saved_lengths[nargs++] = cplen;
+ }
+ len += cplen;
}
- va_end(v);
- dst = x_malloc(len + 2);
- *dst = '\0';
- ptr = str;
- va_start(v, str);
- while (ptr) {
- strcat(dst, ptr);
- ptr = va_arg(v, const char *);
+ va_end(adummy);
+
+ /* Allocate the required string */
+ res = (char *)x_malloc(len + 2);
+ cp = res;
+
+ /* Pass two --- copy the argument strings into the result space */
+ va_start(adummy, str);
+
+ nargs = 0;
+ len = saved_lengths[nargs++];
+ memcpy(cp, str, len);
+ cp += len;
+
+ while ((argp = va_arg(adummy, char *)) != NULL) {
+ if (nargs < MAX_SAVED_LENGTHS) {
+ len = saved_lengths[nargs++];
+ }
+ else {
+ len = strlen(argp);
+ }
+ memcpy(cp, argp, len);
+ cp += len;
}
- va_end(v);
- dst[len + 1] = '\0';
- return dst;
+
+ va_end(adummy);
+ return res;
}
static char *x_strcat(char *dst, const char *add)
@@ -540,7 +615,8 @@
/* Match = 0, NoMatch = 1, Abort = -1
* Based loosely on sections of wildmat.c by Rich Salz
*/
-static int wildchar_match(const char *str, const char *exp, int icase)
+static int wchrmatch(const char *str, const char *exp,
+ size_t *match, int icase)
{
int x, y;
@@ -553,16 +629,22 @@
return 0;
while (str[x]) {
int ret;
- if ((ret = wildchar_match(&str[x++], &exp[y], icase)) != 1)
+ if (match)
+ *match = (size_t)x;
+ if ((ret = wchrmatch(&str[x++], &exp[y], match, icase)) != 1)
return ret;
}
+ if (match)
+ *match = 0;
return -1;
}
else if (exp[y] != '?') {
- if (icase && (tolower(str[x]) != tolower(exp[y])))
+ if (icase) {
+ if (tolower((unsigned char)str[x]) != tolower((unsigned char)exp[y]))
+ return 1;
+ }
+ else if (str[x] != exp[y])
return 1;
- else if (!icase && str[x] != exp[y])
- return 1;
}
}
return (str[x] != '\0');
@@ -600,7 +682,7 @@
/* Reject all ctrl codes... Escape \n and \r (ascii 10 and 13) */
0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
- 1,1,2,1,3,3,3,3,3,3,2,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,3,2,1,2,2,
+ 1,1,2,1,3,3,3,3,3,3,2,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,3,2,1,2,2,
/* @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ */
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,3,2,3,3,1,
/* ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ */
@@ -692,6 +774,319 @@
/*
* ---------------------------------------------------------------------
+ * begin of path utilities
+ * ---------------------------------------------------------------------
+ */
+
+static const char *posixmatch[] = {
+ "/cygdrive/?/*",
+ "/dev/fs/?/*",
+ "/bin/*",
+ "/dev/*",
+ "/etc/*",
+ "/home/*",
+ "/lib/*",
+ "/opt/*",
+ "/proc/*",
+ "/usr/*",
+ "/tmp/*",
+ "/var/*",
+ NULL
+};
+
+static char windrive[] = { '\0', ':', '\\', '\0'};
+static char *posixroot = NULL;
+static char *msvcpath = NULL;
+
+static int checkposix(const char *str)
+{
+ const char *equ;
+ const char **mp = posixmatch;
+
+ if ((equ = strchr(str, '='))) {
+ /* Special case for environment variables */
+ if (*(equ + 1) == '/' && equ < strchr(str, '/'))
+ str = equ + 1;
+ }
+ while (*mp) {
+ if (wchrmatch(str, *mp, NULL, 1) == 0) {
+ return 1;
+ }
+ mp++;
+ }
+
+ return 0;
+}
+
+static char **tokenizepath(const char *str, size_t *tokens)
+{
+ size_t c = 1;
+ char **array = NULL;
+ const char *b;
+ const char *e;
+ const char *s;
+
+ b = s = str;
+ while ((e = strchr(b, ':'))) {
+ int ch = *(e + 1);
+ if (ch == '/' || ch == '.' || ch == ':' ||
+ ch == '\0') {
+ /* Is the previous token path or flag */
+ if (checkposix(s)) {
+ c++;
+ s = e + 1;
+ }
+ }
+ b = e + 1;
+ }
+ array = a_alloc(c);
+ c = 0;
+ b = s = str;
+ while ((e = strchr(b, ':'))) {
+ int ch = *(e + 1);
+ if (ch == '/' || ch == '.' || ch == ':' ||
+ ch == '\0') {
+ /* Is the previous token path or flag */
+ if (checkposix(s)) {
+ array[c++] = x_strndup(b, e - b);
+ s = e + 1;
+ }
+ }
+ b = e + 1;
+ }
+ array[c++] = x_strdup(s);
+ if (tokens)
+ *tokens = c;
+ return array;
+}
+
+static char *mergepaths(char * const *paths)
+{
+ size_t len = 0;
+ char *rv;
+ char *const *pp;
+
+ pp = paths;
+ while (*pp) {
+ len += (strlen(*pp) + 1);
+ pp++;
+ }
+ rv = x_malloc(len + 1);
+
+ len = 0;
+ pp = paths;
+ while (*pp) {
+ if (len++)
+ strcat(rv, ";");
+ strcat(rv, *pp);
+ pp++;
+ }
+ return rv;
+}
+
+static char *posix2win(const char *str, int reverse)
+{
+ char *rv = NULL;
+ char **pa;
+ size_t i, tokens;
+
+ pa = tokenizepath(str, &tokens);
+ for (i = 0; i < tokens; i++) {
+ size_t mx = 0;
+ char *pp;
+ char *ep = NULL;
+ const char **mp = posixmatch;
+
+ if ((pp = strchr(pa[i], '='))) {
+ /* Special case for environment variables */
+ if (*(pp + 1) == '/' && pp < strchr(pa[i], '/')) {
+ ep = pa[i];
+ *(pp++) = '\0';
+ }
+ else
+ pp = pa[i];
+ }
+ else
+ pp = pa[i];
+ while (*mp) {
+ size_t match = 0;
+ if (wchrmatch(pp, *mp, &match, 1) == 0) {
+ char *lp = pp + match;
+ const char *wp;
+ if (mx < 2) {
+ /* Absolute path */
+ wp = windrive;
+ lp += (strlen(*mp) - 1);
+ }
+ else {
+ /* Posix internal path */
+ wp = posixroot;
+ }
+ if (reverse) {
+ char *rp = lp;
+ while (IS_FNCHAR(*rp)) {
+ if (*rp == '/')
+ *rp = '\\';
+ rp++;
+ }
+ }
+ rv = pa[i];
+ if (ep)
+ pa[i] = x_strvcat(ep, "=", wp, lp, NULL);
+ else
+ pa[i] = x_strvcat(wp, lp, NULL);
+ x_free(rv);
+ break;
+ }
+ mx++;
+ mp++;
+ }
+
+ }
+ rv = mergepaths(pa);
+ a_free(pa);
+ return rv;
+}
+
+static void reprelative(char *str)
+{
+ size_t match;
+
+ while (wchrmatch(str, "*./*", &match, 1) == 0) {
+ char *ep = str + match;
+ /* Replace till the end of path element */
+ while (IS_FNCHAR(*ep)) {
+ if (*ep == '/')
+ *ep = '\\';
+ ep++;
+ }
+ if (*ep)
+ strcat(str, ep);
+ }
+}
+
+static char *findlibpath(const char *name)
+{
+ HMODULE handle;
+ UINT em;
+
+ em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ if (!(handle = LoadLibraryExA(name, NULL, 0))) {
+ handle = LoadLibraryExA(name, NULL,
+ LOAD_WITH_ALTERED_SEARCH_PATH);
+ }
+ SetErrorMode(em);
+
+ if (handle) {
+ char name[MAX_PATH] = { 0 };
+ char *ptr;
+ GetModuleFileNameA(handle, name, MAX_PATH);
+ FreeLibrary(handle);
+ if (ptr = strrchr(name, '\\')) {
+ *ptr = '\0';
+ if (name[1] == ':') {
+ char *rv = x_strdup(name);
+ *rv = toupper((unsigned char)*rv);
+ return rv;
+ }
+ }
+ }
+ return NULL;
+}
+
+static char *getcygdrive(int *drive, int back)
+{
+
+ if (posixroot)
+ return posixroot;
+ posixroot = findlibpath("bash.exe");
+
+ if (posixroot) {
+ char *ptr;
+ if (ptr = strrchr(posixroot, '\\')) {
+ if (!stricmp(ptr, "\\bin")) {
+ *ptr = '\0';
+ if (drive)
+ *drive = *posixroot;
+ if (!back)
+ x_forwardslash(posixroot);
+ }
+ else {
+ x_free(posixroot);
+ posixroot = NULL;
+ }
+ }
+ }
+ return posixroot;
+}
+
+static char *getsuadrive(int *drive, int back)
+{
+ char *sr;
+ if (posixroot)
+ return posixroot;
+
+ if ((sr = getenv("SUA_ROOT"))) {
+ if (strstr(sr, "/dev/fs/")) {
+ char *r;
+ char d[3] = { '\0', ':', '\0' };
+
+ d[0] = *(sr + 8);
+ posixroot = x_strvcat(d, sr + 9, NULL);
+ r = posixroot;
+ while (*r) {
+ if (*r == '/')
+ *r = '\\';
+ r++;
+ }
+ if (*(r - 1) == '\\')
+ *(r - 1) = '\0';
+ if (drive)
+ *drive = d[0];
+ if (!back)
+ x_forwardslash(posixroot);
+ }
+ }
+ return posixroot;
+}
+
+static char *getmsvcpath()
+{
+
+ if (msvcpath)
+ return msvcpath;
+ return (msvcpath = findlibpath("cl.exe"));
+}
+
+static int checkbinary(const char *exe)
+{
+ HMODULE handle;
+ UINT em;
+
+ em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ if (!(handle = LoadLibraryExA(exe, NULL, 0))) {
+ handle = LoadLibraryExA(exe, NULL,
+ LOAD_WITH_ALTERED_SEARCH_PATH);
+ }
+ SetErrorMode(em);
+ if (handle) {
+ FreeLibrary(handle);
+ return 1;
+ }
+ else {
+ errno = ENOENT;
+ return 0;
+ }
+}
+
+/*
+ * ---------------------------------------------------------------------
+ * end of path utilities
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * ---------------------------------------------------------------------
* begin of hash
* ---------------------------------------------------------------------
*/
@@ -887,7 +1282,6 @@
CloseHandle(fh);
return NULL;
}
- printf("Opened %S\n", fname);
return f;
}
@@ -1077,15 +1471,15 @@
}
/*
- * Convert all forward slashes to backward slashes
+ * Convert all backward slashes to forward slashes
* in place.
*/
-static char *fixslash(char *s)
+static char *x_forwardslash(char *s)
{
char *c = s;
for (; *c; c++) {
- if (*c == '/')
- *c = '\\';
+ if (*c == '\\')
+ *c = '/';
}
return s;
}
@@ -1862,6 +2256,8 @@
"mkdir", "Creates a new directory(ies)",
"rmdir", "Removes directory(ies)",
"touch", "Change file timestamps",
+ "exec", "Execute program",
+ "mktemp", "Make temporary filename (unique)",
NULL, NULL
};
@@ -1949,6 +2345,34 @@
return retval;
}
+static int prog_exec_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... program [ARGUMENTS]\n", progname);
+ fprintf(stderr, "Execute program.\n\n");
+ fprintf(stderr, " -c, -C, Replace cygwin paths.\n");
+ fprintf(stderr, " -s, -S, Replace SUA paths.\n");
+ fprintf(stderr, " -r, -R, Replace relative paths.\n");
+ fprintf(stderr, " -e, -E, Keep existing environment.\n");
+ fprintf(stderr, " -f, -F, Use forward slashes.\n\n");
+ fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
+ fprintf(stderr, " --version output version information and exit.\n");
+ fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ return retval;
+}
+
+static int prog_mktemp_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... [TEMPLATE]\n", progname);
+ fprintf(stderr, "Execute program.\n\n");
+ fprintf(stderr, " -d, -D, Make a directory instead file.\n");
+ fprintf(stderr, " -q, -Q, Be quiet.\n");
+ fprintf(stderr, " -u, -U, Unlink file or directory befor exiting.\n\n");
+ fprintf(stderr, " -v, -V, --verbose explain what is being done.\n");
+ fprintf(stderr, " --version output version information and exit.\n");
+ fprintf(stderr, " -h, -H, --help display this help and exit.\n\n");
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -2244,6 +2668,337 @@
return rv;
}
+static BOOL WINAPI console_handler(DWORD ctrl)
+{
+ switch (ctrl) {
+ case CTRL_BREAK_EVENT:
+ return FALSE;
+ case CTRL_C_EVENT:
+ case CTRL_CLOSE_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
+ case CTRL_LOGOFF_EVENT:
+ return TRUE;
+ break;
+ }
+ return FALSE;
+}
+
+static int prog_exec(int argc, const char **argv, const char **env)
+{
+ int i, ch, rv = 0;
+ int drive = 0;
+ int cygwin = 0;
+ int suawin = 0;
+ int keepenv = 0;
+ int relpath = 0;
+ int back = 1;
+ size_t l, envsize;
+ char **mainenvp = NULL;
+ char **mainargv = NULL;
+ char wcpath[MAX_PATH + 32] = { 0 };
+
+ x_free(__pname);
+ __pname = "exec";
+ while ((ch = getopt(argc, argv, "cCeEfFrRsShHvV")) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!strcmp(optarg, "verbose"))
+ verbose = 1;
+ else if (!strcmp(optarg, "version"))
+ return print_banner(1);
+ else if (!strcmp(optarg, "help"))
+ return prog_exec_usage(0);
+ else
+ return prog_exec_usage(EINVAL);
+ break;
+ case 'v':
+ case 'V':
+ verbose = 1;
+ break;
+ case 'h':
+ case 'H':
+ return prog_exec_usage(0);
+ break;
+ case 'c':
+ case 'C':
+ cygwin = 1;
+ break;
+ case 's':
+ case 'S':
+ suawin = 1;
+ break;
+ case 'e':
+ case 'E':
+ keepenv = 1;
+ break;
+ case 'r':
+ case 'R':
+ relpath = 1;
+ break;
+ case 'f':
+ case 'F':
+ back = 0;
+ windrive[2] = '/';
+ break;
+ case '?':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 1) {
+ return prog_exec_usage(EINVAL);
+ }
+ if (!stricmp(argv[0], "java") ||
+ !stricmp(argv[0], "jar") ||
+ !stricmp(argv[0], "javac")) {
+ char *jhome = x_strdup(getenv("JAVA_HOME"));
+ if (!jhome) {
+ /* TODO: Figure out the paths from
+ * the registry
+ */
+ rv = errno = ENOENT;
+ perror("JAVA_HOME environment");
+ goto cleanup;
+ }
+ strcpy(wcpath, jhome);
+ strcat(wcpath, "\\bin\\");
+ strcat(wcpath, argv[0]);
+ strcat(wcpath, ".exe");
+ x_free(jhome);
+ }
+ else if (!stricmp(argv[0], "cc") ||
+ !stricmp(argv[0], "make") ||
+ !stricmp(argv[0], "lib") ||
+ !stricmp(argv[0], "link")) {
+ if (!getmsvcpath()) {
+ rv = errno = ENOENT;
+ perror("Microsoft compiler");
+ goto cleanup;
+ }
+ strcpy(wcpath, getmsvcpath());
+ if (!stricmp(argv[0], "cc"))
+ strcat(wcpath, "\\cl.exe");
+ else if (!stricmp(argv[0], "make"))
+ strcat(wcpath, "\\nmake.exe");
+ else if (!stricmp(argv[0], "lib"))
+ strcat(wcpath, "\\lib.exe");
+ else
+ strcat(wcpath, "\\link.exe");
+ }
+
+ if (cygwin) {
+ if (!(posixroot = getcygdrive(&drive, back))) {
+ rv = errno = ENOENT;
+ perror("Cygwing drive");
+ goto cleanup;
+ }
+ }
+ else if (suawin) {
+ if (!(posixroot = getsuadrive(&drive, back))) {
+ rv = errno = ENOENT;
+ perror("Posix drive");
+ goto cleanup;
+ }
+ }
+ windrive[0] = drive;
+ if (wcpath[0]) {
+ *argv = wcpath;
+ }
+ mainargv = a_alloc(argc);
+ for (i = 0; i < argc ; i++) {
+ if (cygwin || suawin)
+ mainargv[i] = posix2win(argv[i], back);
+ else {
+ mainargv[i] = x_strdup(argv[i]);
+ if (!back)
+ x_forwardslash(mainargv[i]);
+ }
+ if (relpath && back)
+ reprelative(mainargv[i]);
+ }
+ envsize = a_size(env);
+ mainenvp = a_alloc(envsize);
+ for (l = 0; l < envsize; l++) {
+ if (keepenv)
+ mainenvp[l] = x_strdup(env[l]);
+ else {
+ if (cygwin || suawin)
+ mainenvp[l] = posix2win(env[l], back);
+ else {
+ mainenvp[l] = x_strdup(env[l]);
+ if (!back)
+ x_forwardslash(mainenvp[l]);
+ }
+ }
+ }
+ /* We have a valid environment. Install the console handler */
+ SetConsoleCtrlHandler((PHANDLER_ROUTINE)console_handler, TRUE);
+
+ if (checkbinary(mainargv[0])) {
+ if (verbose)
+ fprintf(stdout, "Executing %s\n", mainargv[0]);
+ rv = _spawnvpe(_P_WAIT, mainargv[0], mainargv, mainenvp);
+ if (verbose)
+ fprintf(stdout, "%s: exit(%d)\n", mainargv[0], rv);
+ }
+ else {
+ rv = errno = ENOENT;
+ perror(mainargv[0]);
+ }
+
+cleanup:
+ a_free(mainenvp);
+ a_free(mainargv);
+ x_free(posixroot);
+ x_free(msvcpath);
+ return rv;
+}
+
+static const unsigned char padchar[] =
+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+static int randseed = 0;
+
+static int prog_mktemp(int argc, const char **argv, const char **env)
+{
+ int ch, rv = 0;
+ char path[MAX_PATH] = { 0 };
+ int silent = 0;
+ int mdir = 0;
+ int unsafe = 0;
+ int randnum;
+ char patern[MAX_PATH];
+ register char *start, *trv, *suffp;
+
+ x_free(__pname);
+ __pname = "mktemp";
+ while ((ch = getopt(argc, argv, "dDqQhHuUvV")) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!strcmp(optarg, "verbose"))
+ verbose = 1;
+ else if (!strcmp(optarg, "version"))
+ return print_banner(1);
+ else if (!strcmp(optarg, "help"))
+ return prog_mktemp_usage(0);
+ else
+ return prog_mktemp_usage(1);
+ break;
+ case 'v':
+ case 'V':
+ verbose = 1;
+ break;
+ case 'h':
+ case 'H':
+ return prog_mktemp_usage(0);
+ break;
+ case 'd':
+ case 'D':
+ mdir = 1;
+ break;
+ case 'q':
+ case 'Q':
+ silent = 1;
+ break;
+ case 'u':
+ case 'U':
+ unsafe = 1;
+ break;
+ case '?':
+ return 1;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc > 0)
+ x_strncpy(patern, argv[0], MAX_PATH);
+ else
+ strcpy(patern, "tmp.XXXXXXXX");
+
+ if (GetTempPathA(MAX_PATH - strlen(patern) - 1, path) == 0) {
+ if (!silent)
+ perror("Temp Path");
+ return 1;
+ }
+ strcat(path, patern);
+ x_backslash(path);
+ printf("Temp base %s\n", path);
+ for (trv = path; *trv; ++trv)
+ ;
+ suffp = trv;
+ --trv;
+ if (trv < path) {
+ if (!silent) {
+ errno = EINVAL;
+ perror("Temp Path");
+ }
+ return 1;
+ }
+
+ if (randseed == 0) {
+ randseed = (int)time(NULL);
+ srand(randseed);
+ }
+ /* Fill space with random characters */
+ while (*trv == 'X') {
+ randnum = rand() % (sizeof(padchar) - 1);
+ *trv-- = padchar[randnum];
+ }
+ start = trv + 1;
+
+ for (;;) {
+ if (access(path, 0)) {
+ if (errno == ENOENT) {
+ if (mdir) {
+ if (mkdir(path)) {
+ if (!silent)
+ perror(path);
+ return 1;
+ }
+ if (unsafe)
+ rmdir(path);
+ }
+ else {
+ FILE *fp = fopen(path, "w");
+ if (!fp) {
+ if (!silent)
+ perror(path);
+ return 1;
+ }
+ fclose(fp);
+ if (unsafe)
+ unlink(path);
+ }
+ fputs(path, stdout);
+ return 0;
+ }
+ }
+ /* If we have a collision, cycle through the space of filenames */
+ for (trv = start;;) {
+ char *pad;
+ if (*trv == '\0' || trv == suffp) {
+ if (!silent) {
+ errno = EINVAL;
+ perror("Temp Path");
+ }
+ return 1;
+ }
+ pad = strchr((char *)padchar, *trv);
+ if (pad == NULL || !*++pad) {
+ *trv++ = padchar[0];
+ }
+ else {
+ *trv++ = *pad;
+ break;
+ }
+ }
+
+ }
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -2274,6 +3029,10 @@
return prog_rmdir(--argc, ++argv, env);
else if (!stricmp(argv[1], "touch"))
return prog_touch(--argc, ++argv, env);
+ else if (!stricmp(argv[1], "exec"))
+ return prog_exec(--argc, ++argv, env);
+ else if (!stricmp(argv[1], "mktemp"))
+ return prog_mktemp(--argc, ++argv, env);
else if (!stricmp(argv[1], "test")) {
argc -= 2;
argv += 2;
@@ -2304,6 +3063,15 @@
}
}
+static void cleanup(void)
+{
+ static int cleared = 0;
+
+ if (cleared++)
+ return;
+ /* Make any cleanup here */
+}
+
int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv)
{
char **argv;
@@ -2312,6 +3080,7 @@
int dupenv;
int rv;
+ atexit(cleanup);
/* Find on what we are running */
GetSystemInfo(&win_osinf);
win_osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
16 years, 5 months
JBoss Native SVN: r1492 - in trunk/licenses: info-zip and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-01 10:03:40 -0400 (Tue, 01 Apr 2008)
New Revision: 1492
Added:
trunk/licenses/info-zip/
trunk/licenses/info-zip/LICENSE
Log:
Add info-zip license
Added: trunk/licenses/info-zip/LICENSE
===================================================================
--- trunk/licenses/info-zip/LICENSE (rev 0)
+++ trunk/licenses/info-zip/LICENSE 2008-04-01 14:03:40 UTC (rev 1492)
@@ -0,0 +1,55 @@
+This is version 2005-Feb-10 of the Info-ZIP copyright and license.
+The definitive version of this document should be available at
+ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
+
+
+Copyright (c) 1990-2005 Info-ZIP. All rights reserved.
+
+For the purposes of this copyright and license, "Info-ZIP" is defined as
+the following set of individuals:
+
+ Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+ Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
+ Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+ David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+ Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+ Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
+ Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
+ Rich Wales, Mike White
+
+This software is provided "as is," without warranty of any kind, express
+or implied. In no event shall Info-ZIP or its contributors be held liable
+for any direct, indirect, incidental, special or consequential damages
+arising out of the use of or inability to use this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ definition, disclaimer, and this list of conditions.
+
+ 2. Redistributions in binary form (compiled executables) must reproduce
+ the above copyright notice, definition, disclaimer, and this list of
+ conditions in documentation and/or other materials provided with the
+ distribution. The sole exception to this condition is redistribution
+ of a standard UnZipSFX binary (including SFXWiz) as part of a
+ self-extracting archive; that is permitted without inclusion of this
+ license, as long as the normal SFX banner has not been removed from
+ the binary or disabled.
+
+ 3. Altered versions--including, but not limited to, ports to new operating
+ systems, existing ports with new graphical interfaces, and dynamic,
+ shared, or static library versions--must be plainly marked as such
+ and must not be misrepresented as being the original source. Such
+ altered versions also must not be misrepresented as being Info-ZIP
+ releases--including, but not limited to, labeling of the altered
+ versions with the names "Info-ZIP" (or any variation thereof, including,
+ but not limited to, different capitalizations), "Pocket UnZip," "WiZ"
+ or "MacZip" without the explicit permission of Info-ZIP. Such altered
+ versions are further prohibited from misrepresentative use of the
+ Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s).
+
+ 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
+ "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its
+ own source and binary releases.
Property changes on: trunk/licenses/info-zip/LICENSE
___________________________________________________________________
Name: svn:eol-style
+ native
16 years, 5 months
JBoss Native SVN: r1491 - trunk/build/install/installer.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-01 05:53:12 -0400 (Tue, 01 Apr 2008)
New Revision: 1491
Modified:
trunk/build/install/installer/dhtml.c
trunk/build/install/installer/gui.c
trunk/build/install/installer/main.c
trunk/build/install/installer/sinstall.h
trunk/build/install/installer/sinstall.rc
Log:
Installer updates
Modified: trunk/build/install/installer/dhtml.c
===================================================================
--- trunk/build/install/installer/dhtml.c 2008-03-31 12:15:21 UTC (rev 1490)
+++ trunk/build/install/installer/dhtml.c 2008-04-01 09:53:12 UTC (rev 1491)
@@ -47,7 +47,7 @@
WCHAR szArguments[MBUF_SIZE];
} DHTML_THREAD_PARAMS;
-static LPWSTR
+LPWSTR
AnsiToWide(
LPCSTR szAnsi,
LPWSTR szWide,
@@ -68,7 +68,7 @@
return NULL;
}
-static LPSTR
+LPSTR
WideToAnsi(
LPCWSTR szWide,
LPSTR szAnsi,
@@ -130,7 +130,6 @@
if (!hDlg->lpImk)
goto cleanup;
-
return hDlg;
cleanup:
@@ -199,6 +198,8 @@
LPCSTR szTitle,
DWORD dwWidth,
DWORD dwHeight,
+ DWORD dwFlags,
+ DWORD dwTimeout,
LPCSTR szArguments)
{
DWORD dwThreadId;
@@ -207,17 +208,20 @@
DWORD i;
BOOL rv = FALSE;
DHTML_THREAD_PARAMS pD;
+ int w = -1;
-
if (IS_INVALID_HANDLE(hHtmlDlg))
return FALSE;
pD.hParent = hParent;
pD.hHtmlDlg = hHtmlDlg;
swprintf(pD.szOptions,
- L"scroll: no; help: no; dialogHeight: %dpx; dialogWidth: %dpx",
+ L"scroll: no; status: no; help: no; dialogHeight: %dpx; dialogWidth: %dpx",
dwHeight, dwWidth);
- AnsiToWide(szArguments, pD.szArguments,
- ARRAYSIZE(pD.szArguments));
+ if (dwFlags == 1)
+ wcscat(pD.szOptions, L"; unadorned:yes");
+ if (szArguments)
+ AnsiToWide(szArguments, pD.szArguments,
+ ARRAYSIZE(pD.szArguments));
hThread = CreateThread(NULL,
0,
@@ -231,6 +235,7 @@
/* Hack to change the Icon of HTML Dialog */
for (i = 0; i < 1000; i++) {
if ((hWnd = FindWindowEx(hParent, NULL, NULL, szTitle))) {
+ w = GuiRegisterWindow(hWnd);
SetClassLong(hWnd, GCL_HICONSM, (LONG)gui_h16Icon);
break;
}
@@ -238,11 +243,17 @@
break;
Sleep(1);
}
- WaitForSingleObject(hThread, INFINITE);
+ if ((i = WaitForSingleObject(hThread, dwTimeout)) == WAIT_TIMEOUT) {
+ if (hWnd) {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+ WaitForSingleObject(hThread, INFINITE);
+ }
+ }
if (GetExitCodeThread(hThread, &i) && i == 0) {
rv = TRUE;
}
CloseHandle(hThread);
+ GuiUnregisterWindow(w);
return rv;
}
Modified: trunk/build/install/installer/gui.c
===================================================================
--- trunk/build/install/installer/gui.c 2008-03-31 12:15:21 UTC (rev 1490)
+++ trunk/build/install/installer/gui.c 2008-04-01 09:53:12 UTC (rev 1491)
@@ -29,10 +29,13 @@
#include <stdio.h>
#include <string.h>
+#define MGUI_WINDOWS 32
+
HICON gui_h16Icon = NULL;
HICON gui_h32Icon = NULL;
HICON gui_h48Icon = NULL;
HMODULE gui_hMSHTML = NULL;
+HWND gui_DialogWnd = NULL;
static HINSTANCE gui_hInstance = NULL;
static HWND gui_hMainWnd = NULL;
static HMODULE gui_hRichedit = NULL;
@@ -40,9 +43,33 @@
static UINT gui_ucNumLines = 3;
static CHAR gui_szWndClass[MAX_PATH];
+
+static HWND gui_Windows[MGUI_WINDOWS];
+
+int
+GuiRegisterWindow(HWND hWnd)
+{
+ int i;
+ for (i = 0; i < MGUI_WINDOWS; i++) {
+ if (!gui_Windows[i]) {
+ gui_Windows[i] = hWnd;
+ return i;
+ }
+ }
+ return -1;
+}
+
+void
+GuiUnregisterWindow(int nIndex)
+{
+ if (nIndex >= 0 && nIndex < MGUI_WINDOWS)
+ gui_Windows[nIndex] = NULL;
+}
+
BOOL
GuiInitialize()
{
+ int i;
INITCOMMONCONTROLSEX stCmn;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -66,12 +93,21 @@
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
&gui_ucNumLines, 0);
+ for (i = 0; i < MGUI_WINDOWS; i++)
+ gui_Windows[i] = NULL;
return TRUE;
}
BOOL
GuiTerminate()
{
+ int i;
+ for (i = 0; i < MGUI_WINDOWS; i++) {
+ if (gui_Windows[i]) {
+ SendMessage(gui_Windows[i], WM_CLOSE, 0, 0);
+ gui_Windows[i] = NULL;
+ }
+ }
FreeLibrary(gui_hRichedit);
FreeLibrary(gui_hMSHTML);
@@ -180,12 +216,24 @@
{
static HWND hRich = NULL;
static POINT ptScroll;
+ static int nIndex = -1;
HRSRC hRsrc;
HGLOBAL hGlob;
LPSTR szTxt;
switch (uMsg) {
+ case WM_DESTROY:
+ GuiUnregisterWindow(nIndex);
+ nIndex = -1;
+ PostQuitMessage(0);
+ break;
+ case WM_CLOSE:
+ GuiUnregisterWindow(nIndex);
+ nIndex = -1;
+ return FALSE;
+ break;
case WM_INITDIALOG:
+ nIndex = GuiRegisterWindow(hDlg);
GuiCenterWindow(hDlg);
hRich = GetDlgItem(hDlg, IDC_LICENSE);
hRsrc = FindResourceA(GetModuleHandleA(NULL),
@@ -239,3 +287,36 @@
(DLGPROC)guiAboutDlgProc);
}
+BOOL
+GuiYesNoMessage(
+ HWND hWnd,
+ LPCTSTR szTitle,
+ LPCTSTR szMessage,
+ BOOL bStop)
+{
+ UINT uType = MB_YESNO | MB_APPLMODAL;
+
+ if (bStop)
+ uType |= MB_DEFBUTTON2 | MB_ICONEXCLAMATION;
+ else
+ uType |= MB_DEFBUTTON1 | MB_ICONQUESTION;
+
+ return (MessageBoxA(hWnd, szMessage, szTitle, uType) == IDYES);
+}
+
+BOOL
+GuiOkMessage(
+ HWND hWnd,
+ LPCTSTR szTitle,
+ LPCTSTR szMessage,
+ BOOL bStop)
+{
+ UINT uType = MB_OK | MB_APPLMODAL;
+
+ if (bStop)
+ uType |= MB_ICONSTOP;
+ else
+ uType |= MB_ICONINFORMATION;
+
+ return (MessageBoxA(hWnd, szMessage, szTitle, uType) == IDYES);
+}
Modified: trunk/build/install/installer/main.c
===================================================================
--- trunk/build/install/installer/main.c 2008-03-31 12:15:21 UTC (rev 1490)
+++ trunk/build/install/installer/main.c 2008-04-01 09:53:12 UTC (rev 1491)
@@ -44,6 +44,7 @@
static LPCSTR CMD_PREFIX = "%s /E:ON /S /C \"SET JBINSTALL_PPID=%d&&CALL %s ";
static LPCSTR CMD_SUFIX = "> install.log 2>&1\"";
static LPCSTR CMD_BATCH = "install.bat";
+static LPCSTR CMD_PARAM = "install";
static LPCSTR DIR_BATCH = "\\_install";
static LPCSTR CMD_QUOTE = " &()[]{}^=;!'+,`~";
static LPSTR ppUnizpArgs[] = { "unzip", "-qq", "-d", NULL, NULL };
@@ -94,6 +95,51 @@
0
};
+static int
+ErrorMessage(
+ LPCSTR szTitle,
+ LPCSTR szError,
+ BOOL bFatal)
+{
+ LPVOID lpMsgBuf = NULL;
+ UINT nType;
+ int nRet = 0;
+ DWORD dwErr = GetLastError();
+
+ if (bFatal)
+ nType = MB_ICONERROR | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL;
+ else
+ nType = MB_ICONEXCLAMATION | MB_OK | MB_APPLMODAL;
+ if (szError) {
+#ifdef _CONSOLE
+ fprintf(stderr, "Application Error (08X): %s\n", dwErr, szError);
+#else
+ nRet = MessageBoxA(NULL, szError, "Application Error", nType);
+#endif
+ }
+ else {
+ if (!szTitle)
+ szTitle = "Application System Error";
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ dwErr,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
+ (LPSTR) &lpMsgBuf, 0, NULL);
+#ifdef _CONSOLE
+ fprintf(stderr, "%s (08X): %s\n", dwErr,
+ szTitle, (LPCSTR)lpMsgBuf);
+#else
+ nRet = MessageBoxA(NULL, (LPCSTR)lpMsgBuf,
+ szTitle, nType);
+#endif
+
+ LocalFree(lpMsgBuf);
+ }
+ return nRet;
+}
+
int x_cerror(int err)
{
if (err == 0) {
@@ -124,7 +170,18 @@
int err = errno;
errno = x_cerror(err);
- perror(msg);
+
+#ifdef _CONSOLE
+ if (!opt_Quiet)
+ perror(msg);
+ if (opt_Verbose)
+ fprintf(stderr, "(%s): exit(%d)\n", GetProgramName(), err);
+#else
+ if (GetLastError() == 0 && err)
+ SetLastError(err);
+ if (!opt_Quiet)
+ ErrorMessage(msg, NULL, TRUE);
+#endif
exit(err);
}
@@ -160,7 +217,34 @@
return p;
}
+/*
+ * Makes a full path from partial path
+ */
+static char *x_fullpath(const char *path, char *buf)
+{
+ char full[MAX_PATH];
+ char *fn;
+ size_t len;
+ len = GetFullPathNameA(path,
+ MAX_PATH,
+ full, &fn);
+ if (len >= MAX_PATH) {
+ errno = ERANGE;
+ return NULL;
+ }
+ if (len == 0) {
+ errno = EINVAL;
+ return NULL;
+ }
+ if (buf) {
+ strcpy(buf, full);
+ return buf;
+ }
+ else
+ return x_strdup(full);
+}
+
LPCSTR
GetProgramName()
{
@@ -185,6 +269,29 @@
return szProgramName;
}
+static LPSTR
+GetHtmlPath(
+ LPCSTR szWorkDir,
+ LPCSTR szHtmlPage)
+{
+
+ LPSTR p;
+ LPSTR pHtml = (LPSTR)x_malloc(MAX_PATH);
+
+ strcpy(pHtml, "file://");
+ if (szWorkDir) {
+ strcpy(pHtml, szWorkDir);
+ if (*szHtmlPage != '/')
+ strcat(pHtml, "/");
+ }
+ strcat(pHtml, szHtmlPage);
+ for (p = pHtml; *p; p++) {
+ if (*p == '\\')
+ *p = '/';
+ }
+ return pHtml;
+}
+
LPCSTR
GetProgramPath()
{
@@ -211,10 +318,13 @@
static void vwarnx(const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", GetProgramName());
- if (fmt != NULL)
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
+
+ if (!opt_Quiet) {
+ fprintf(stderr, "%s: ", GetProgramName());
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ }
}
static void warnx(const char *fmt, ...)
@@ -353,51 +463,7 @@
return optopt; /* return option letter */
}
-
static int
-ErrorMessage(
- LPCSTR szError,
- BOOL bFatal)
-{
- LPVOID lpMsgBuf = NULL;
- UINT nType;
- int nRet = 0;
- DWORD dwErr = GetLastError();
-
- if (bFatal)
- nType = MB_ICONERROR | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL;
- else
- nType = MB_ICONEXCLAMATION | MB_OK;
- if (szError) {
-#ifdef _CONSOLE
- nRet = MessageBoxA(NULL, szError, "Application Error", nType);
-#else
- fprintf(stderr, "Application Error (08X): %s\n", dwErr, szError);
-#endif
- }
- else {
- FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- dwErr,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
- (LPSTR) &lpMsgBuf, 0, NULL);
-#ifdef _CONSOLE
- nRet = MessageBoxA(NULL, (LPCSTR)lpMsgBuf,
- "Application System Error", nType);
-#else
- fprintf(stderr, "Application Error (08X): %s\n", dwErr,
- (LPCSTR)lpMsgBuf);
-#endif
-
- LocalFree(lpMsgBuf);
- }
- return nRet;
-}
-
-
-static int
SXDeleteDirectory(LPCSTR szName)
{
SHFILEOPSTRUCTA shfop;
@@ -409,32 +475,40 @@
return SHFileOperationA(&shfop);
}
-static void
+static int
+SXCreateDirectory(LPCSTR szName)
+{
+ return SHCreateDirectoryExA(NULL, szName, NULL);
+}
+
+
+static LPSTR
BuildCommandLine(
- LPSTR szBuf,
LPCSTR szCmdExe,
LPCSTR szBatchFile,
...)
{
+ char *buf;
char *p;
va_list vl;
va_start(vl, szBatchFile);
- sprintf(szBuf, CMD_PREFIX, szCmdExe,
+ buf = x_malloc(MAX_CMDLINE);
+ sprintf(buf, CMD_PREFIX, szCmdExe,
_getpid(), szBatchFile);
while ((p = va_arg(vl, char *)) != NULL) {
if (p[strcspn(p, CMD_QUOTE)]) {
- strcat(szBuf, "\"");
- strcat(szBuf, p);
- strcat(szBuf, "\"");
+ strcat(buf, "\"");
+ strcat(buf, p);
+ strcat(buf, "\"");
}
else
- strcat(szBuf, p);
- strcat(szBuf, " ");
+ strcat(buf, p);
+ strcat(buf, " ");
}
va_end(vl);
- strcat(szBuf, CMD_SUFIX);
- fprintf(stdout, "Service Cmd %s\n", szBuf);
+ strcat(buf, CMD_SUFIX);
+ return buf;
}
@@ -448,6 +522,11 @@
STARTUPINFO stInfo;
BOOL bResult;
+ if (opt_Verbose) {
+ fprintf(stdout, "Executing: %s\n", szApplication);
+ fprintf(stdout, " %s\n", szCmdLine);
+ fprintf(stdout, " in %s\n", szWorkingPath);
+ }
ZeroMemory(&stInfo, sizeof(stInfo));
stInfo.cb = sizeof(stInfo);
stInfo.dwFlags = STARTF_USESHOWWINDOW;
@@ -480,11 +559,11 @@
sprintf(sBuf, "%s", GetProgramName());
DHTMLDialogRun(NULL, hHtml,
- "Accept License Agreement",
- 505, 360,
+ GuiLoadResource(IDS_LICTITLE, 0),
+ 505, 360, 0, INFINITE,
sBuf);
retVal = DHTMLDialogResult(hHtml);
- if (retVal && !strcmp(retVal, "OK")) {
+ if (retVal && !strncmp(retVal, "OK", 2)) {
rv = TRUE;
}
DHTMLDialogClose(hHtml);
@@ -492,6 +571,56 @@
return rv;
}
+static BOOL
+RunCustomPage(
+ LPCSTR szHtmlPage,
+ LPCSTR szHtmlTitle,
+ LPCSTR szHtmlParams,
+ DWORD dwHtmlWidth,
+ DWORD dwHtmlHeight,
+ DWORD dwTimeout,
+ DWORD dwFlags,
+ LPCSTR szFile)
+{
+ HANDLE hHtml;
+ LPSTR szUrl;
+ LPSTR retVal;
+ BOOL rv = FALSE;
+ FILE *fp;
+
+ szUrl = GetHtmlPath(NULL, szHtmlPage);
+ hHtml = DHTMLDialogInit(NULL, szUrl);
+ if (IS_INVALID_HANDLE(hHtml))
+ return FALSE;
+
+ DHTMLDialogRun(NULL, hHtml,
+ szHtmlTitle,
+ dwHtmlWidth,
+ dwHtmlHeight,
+ dwFlags,
+ dwTimeout,
+ szHtmlParams);
+ retVal = DHTMLDialogResult(hHtml);
+ if (szFile)
+ fp = fopen(szFile, "w");
+ else
+ fp = stdout;
+ if (fp) {
+ if (retVal && *retVal) {
+ if (!strncmp(retVal, "OK", 2))
+ rv = TRUE;
+ fputs(retVal, fp);
+ }
+ else
+ fputs("NULL", fp);
+ fflush(fp);
+ if (fp != stdout)
+ fclose(fp);
+ }
+ DHTMLDialogClose(hHtml);
+ return rv;
+}
+
static void ExitCleanup(void)
{
static int cleanup = 0;
@@ -535,21 +664,32 @@
int nShowCmd)
{
#endif
- int i, r, ch;
- int ap = 1;
- int hasDest = 0;
- LPSTR szCmdLine = NULL;
- CHAR szBuf[MAX_PATH];
- CHAR szCmdExe[MAX_PATH];
- CHAR szDest[MAX_PATH] = { 0 };
+ int i, r, ch;
+ int ap = 1;
+ size_t l;
+ BOOL selectDest = TRUE;
+ LPSTR szCmdLine = NULL;
+ CHAR szBuf[MAX_PATH];
+ CHAR szCmdExe[MAX_PATH];
+ CHAR szWorkDir[MAX_PATH];
+ CHAR szDest[MAX_PATH] = { 0, 0 };
+
+ LPSTR szHtmlPage = NULL;
+ LPSTR szHtmlTitle = NULL;
+ LPSTR szHtmlParams = NULL;
+ LPSTR szHtmlResult = NULL;
+ DWORD dwHtmlWidth = 505;
+ DWORD dwHtmlHeight = 360;
+ DWORD dwTimeout = INFINITE;
+ DWORD dwFlags = 0;
PROCESS_INFORMATION prInfo;
-
+
atexit(ExitCleanup);
if (!GuiInitialize()) {
exit(-1);
}
- while ((ch = getopt(__argc, __argv, "aAd:D:hHqQvV")) != EOF) {
+ while ((ch = getopt(__argc, __argv, "aAd:f:h:n:p:qQr:st:vVw:")) != EOF) {
switch (ch) {
case 'a':
case 'A':
@@ -560,38 +700,123 @@
case 'q':
case 'Q':
opt_Quiet = TRUE;
+ opt_Verbose = FALSE;
break;
case 'v':
case 'V':
- opt_Verbose = TRUE;
+#ifdef _CONSOLE
+ /* Verbosity makes sense in console
+ * mode only
+ */
+ if (!opt_Quiet)
+ opt_Verbose = TRUE;
+#endif
break;
case 'd':
- case 'D':
- hasDest = ap++;
+ if (*optarg != '~') {
+ if (x_fullpath(optarg, szDest))
+ selectDest = FALSE;
+ }
+ else {
+ szDest[0] = '~';
+ selectDest = FALSE;
+ }
break;
+ case 'n':
+ szHtmlTitle = x_strdup(optarg);
+ break;
+ case 'r':
+ szHtmlPage = x_fullpath(optarg, NULL);
+ break;
+ case 's':
+ dwFlags = 1;
+ break;
+ case 'f':
+ szHtmlResult = x_fullpath(optarg, NULL);
+ break;
+ case 'p':
+ szHtmlParams = x_strdup(optarg);
+ for (l = 0; l < strlen(szHtmlParams); l++) {
+ if (szHtmlParams[l] == ',')
+ szHtmlParams[l] = '\t';
+ }
+ break;
+ case 't':
+ dwTimeout = (DWORD)atoi(optarg);
+ break;
+ case 'w':
+ dwHtmlWidth = (DWORD)atoi(optarg);
+ break;
+ case 'h':
+ dwHtmlHeight = (DWORD)atoi(optarg);
+ break;
+ case '?':
+ r = EINVAL;
+ goto cleanup;
+ break;
}
}
__argc -= optind;
__argv += optind;
- if (!AcceptLicensePage()) {
+ if (szHtmlPage) {
+ if (!szHtmlTitle) {
+ r = EINVAL;
+ goto cleanup;
+ }
+ if (RunCustomPage(szHtmlPage,
+ szHtmlTitle,
+ szHtmlParams,
+ dwHtmlWidth,
+ dwHtmlHeight,
+ dwTimeout,
+ dwFlags,
+ szHtmlResult)) {
+ r = 0;
+ }
+ else
+ r = EACCES;
+ x_free(szHtmlPage);
+ x_free(szHtmlTitle);
+ x_free(szHtmlParams);
+ x_free(szHtmlResult);
+ goto cleanup;
+ }
+ /* Standard Install */
+ if (!opt_Quiet && !AcceptLicensePage()) {
r = EPERM;
goto cleanup;
}
- if (hasDest) {
- strcpy(szDest, __argv[hasDest - 1]);
- /* TODO: Check if valid */
- }
- else {
+ if (selectDest) {
if (!GuiBrowseForFolder(NULL,
- "Select Installation Directory",
+ GuiLoadResource(IDS_SELDEST, 0),
szDest)) {
r = EACCES;
goto cleanup;
}
}
- szCmdLine = (char *)x_malloc(MAX_CMDLINE);
-
+ if (szDest[0] != '~' && access(szDest, 06)) {
+ if (errno == ENOENT) {
+ char msg[MAX_PATH + 64];
+ sprintf(msg, GuiLoadResource(IDS_NDIRMSG, 0),
+ szDest);
+ if (GuiYesNoMessage(NULL,
+ GuiLoadResource(IDS_NDIRTITLE, 1),
+ msg,
+ FALSE)) {
+ if (SXCreateDirectory(szDest)) {
+ x_perror(szDest);
+ }
+ }
+ else {
+ r = 0;
+ goto cleanup;
+ }
+ }
+ else {
+ x_perror(szDest);
+ }
+ }
if (GetSystemDirectory(szBuf, MAX_PATH - 20)) {
strcat(szBuf, "\\cmd.exe");
if (strchr(szBuf, ' ')) {
@@ -603,19 +828,16 @@
strcpy(szCmdExe, szBuf);
}
else {
- perror("System Directory");
- exit(-1);
+ x_perror("System Directory");
}
if (GetTempPathA(MAX_PATH - 20, szBuf) == 0) {
- perror("Temp Path");
- exit(-1);
+ x_perror("Temp Path");
}
for (i = 0; i < 100; i++) {
CHAR szTmp[MAX_PATH];
if (GetTempFileName(szBuf, "_sx", _getpid(), szTmp) == 0) {
- perror("Temp File");
- exit(-1);
+ x_perror("Temp File");
}
if (!mkdir(szTmp)) {
strcpy(szTempPath, szTmp);
@@ -623,41 +845,51 @@
}
else {
if (errno != EEXIST) {
- perror("Creating Temp directory");
- exit(-1);
+ x_perror("Creating Temp directory");
}
}
}
if (!szTempPath[0]) {
errno = EPERM;
- perror("Creating Temp directory");
- exit(-1);
+ x_perror("Creating Temp directory");
}
-#if 0
+ strcpy(szWorkDir, szTempPath);
+ strcat(szWorkDir, DIR_BATCH);
ppUnizpArgs[3] = szTempPath;
- printf("Running main %s\n", szTempPath);
+ if (opt_Verbose) {
+ fprintf(stdout, "Running main: %s\n", szTempPath);
+ }
+ /* Unzip the embeded archive */
CONSTRUCTGLOBALS();
r = unzip(4, ppUnizpArgs);
+ if (r != 0) {
+ SetLastError(ERROR_INVALID_BLOCK);
+ errno = EINVAL;
+ x_perror("Uncompressing");
+ }
DESTROYGLOBALS();
- if (RunChildProcess(szCmdExe, szCmdLine, szBuf, &prInfo)) {
+ szCmdLine = BuildCommandLine(szCmdExe,
+ CMD_BATCH,
+ CMD_PARAM,
+ szDest,
+ NULL);
+ if (RunChildProcess(szCmdExe, szCmdLine, szWorkDir, &prInfo)) {
-
- }
-
-#endif
- strcpy(szBuf, szTempPath);
- strcat(szBuf, DIR_BATCH);
- BuildCommandLine(szCmdLine, szCmdExe, CMD_BATCH,
- "install", szDest, NULL);
- if (RunChildProcess(szCmdExe, szCmdLine, szBuf, &prInfo)) {
-
r = 0;
}
else
r = GetLastError();
- printf("(%s) Done %d!\n", GetProgramName(), r);
+#if 0
+ GuiOkMessage(NULL,
+ "Continue",
+ "Click OK to continue",
+ TRUE);
+#endif
cleanup:
+ if (opt_Verbose) {
+ fprintf(stdout, "(%s) exit(%d)\n", GetProgramName(), r);
+ }
x_free(szCmdLine);
ExitCleanup();
return r;
Modified: trunk/build/install/installer/sinstall.h
===================================================================
--- trunk/build/install/installer/sinstall.h 2008-03-31 12:15:21 UTC (rev 1490)
+++ trunk/build/install/installer/sinstall.h 2008-04-01 09:53:12 UTC (rev 1491)
@@ -97,8 +97,11 @@
#define IDS_DLLFILES 156
#define IDS_EXEFILES 157
#define IDS_PPIMAGE 158
+#define IDS_SELDEST 159
+#define IDS_NDIRMSG 160
+#define IDS_NDIRTITLE 162
+#define IDS_LICTITLE 163
-
#define IDD_ABOUTBOX 250
#define IDC_LICENSE 251
#define IDR_LICENSE 252
@@ -109,22 +112,33 @@
#define SIZ_BUFMAX (SIZ_BUFLEN - 1)
#define IS_INVALID_HANDLE(x) (((x) == NULL || (x) == INVALID_HANDLE_VALUE))
+LPCSTR GetProgramName();
+LPWSTR AnsiToWide(LPCSTR, LPWSTR, DWORD);
+LPSTR WideToAnsi(LPCWSTR, LPSTR, DWORD);
+
BOOL GuiInitialize();
BOOL GuiTerminate();
+int GuiRegisterWindow();
+void GuiUnregisterWindow(int);
+
+
LPSTR GuiLoadResource(UINT, UINT);
void GuiCenterWindow(HWND);
BOOL GuiBrowseForFolder(HWND, LPCSTR, LPSTR);
void GuiAboutBox(HWND);
+BOOL GuiYesNoMessage(HWND, LPCTSTR, LPCTSTR, BOOL);
+BOOL GuiOkMessage(HWND, LPCTSTR, LPCTSTR, BOOL);
HICON gui_h16Icon;
HICON gui_h32Icon;
HICON gui_h48Icon;
HMODULE gui_hMSHTML;
+HWND gui_DialogWnd;
HANDLE DHTMLDialogInit(HINSTANCE, LPCSTR);
void DHTMLDialogClose(HANDLE);
-BOOL DHTMLDialogRun(HWND, HANDLE, LPCSTR, DWORD, DWORD, LPCSTR);
+BOOL DHTMLDialogRun(HWND, HANDLE, LPCSTR, DWORD, DWORD, DWORD, DWORD, LPCSTR);
LPSTR DHTMLDialogResult(HANDLE);
#endif /* SINSTALL_H */
Modified: trunk/build/install/installer/sinstall.rc
===================================================================
--- trunk/build/install/installer/sinstall.rc 2008-03-31 12:15:21 UTC (rev 1490)
+++ trunk/build/install/installer/sinstall.rc 2008-04-01 09:53:12 UTC (rev 1491)
@@ -78,7 +78,11 @@
IDS_ALLFILES "All Files (*.*)\0*.*\0"
IDS_DLLFILES "Dynamic Link Libraries (*.dll)\0*.dll\0"
IDS_EXEFILES "Executables (*.exe)\0*.exe\0"
- IDS_PPIMAGE "Select Executable Image"
+ IDS_PPIMAGE "Select Executable Image\0"
+ IDS_SELDEST "Select Installation Base Directory"
+ IDS_NDIRMSG "Destination directory\r\n%s\r\ndoes not exist. Create directory ?"
+ IDS_NDIRTITLE "Directory does not exist"
+ IDS_LICTITLE "Accept License Agreement"
END
16 years, 5 months