JBoss Native SVN: r1530 - in trunk/build/install/installer: res and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 11:43:50 -0400 (Mon, 07 Apr 2008)
New Revision: 1530
Added:
trunk/build/install/installer/res/jbrhorg.png
trunk/build/install/installer/res/splash.htm
Modified:
trunk/build/install/installer/main.c
trunk/build/install/installer/sinstall.rc
Log:
Add splash option
Modified: trunk/build/install/installer/main.c
===================================================================
--- trunk/build/install/installer/main.c 2008-04-07 14:27:14 UTC (rev 1529)
+++ trunk/build/install/installer/main.c 2008-04-07 15:43:50 UTC (rev 1530)
@@ -846,6 +846,32 @@
}
static BOOL
+ShowSplash(LPCSTR szPage, DWORD dwTimeout)
+{
+ HANDLE hHtml;
+ CHAR sBuf[MAX_PATH] = { 0 };
+ CHAR *retVal;
+ BOOL rv = FALSE;
+
+ hHtml = DHTMLDialogInit(GetModuleHandle(NULL), szPage);
+ if (IS_INVALID_HANDLE(hHtml))
+ return FALSE;
+
+ sprintf(sBuf, "%s", GetProgramName());
+ DHTMLDialogRun(NULL, hHtml,
+ "JBoss",
+ DEF_WWIDTH, DEF_WHEIGHT, 1, dwTimeout,
+ sBuf);
+ retVal = DHTMLDialogResult(hHtml);
+ if (retVal && !strncmp(retVal, "OK", 2)) {
+ rv = TRUE;
+ }
+ DHTMLDialogClose(hHtml);
+
+ return rv;
+}
+
+static BOOL
RunCustomPage(
LPCSTR szHtmlPage,
LPCSTR szHtmlTitle,
@@ -1204,7 +1230,11 @@
x_free(szHtmlResult);
goto cleanup;
}
+ if (bShowSplash) {
+ ShowSplash("/HTML_SPLASH", dwSplTimeout);
+ }
+
/* Standard Install */
if (bShowLicense && !AcceptLicensePage(szEulaPage)) {
r = EPERM;
Added: trunk/build/install/installer/res/jbrhorg.png
===================================================================
(Binary files differ)
Property changes on: trunk/build/install/installer/res/jbrhorg.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Added: trunk/build/install/installer/res/splash.htm
===================================================================
--- trunk/build/install/installer/res/splash.htm (rev 0)
+++ trunk/build/install/installer/res/splash.htm 2008-04-07 15:43:50 UTC (rev 1530)
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HEAD lang="en">
+ <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
+ <META http-equiv="MSThemeCompatible" content="Yes">
+ <TITLE>JBoss</TITLE>
+ <STYLE type="text/css">
+ BODY, TABLE, TR, TD, UL, OL, LI, P {
+ font-family: MS Shell Dlg;
+ font-size: 10px;
+ font-style: normal;
+ text-decoration: none;
+ background-color: ButtonFace;
+ color: ButtonText;
+ }
+ INPUT {
+ font-family: MS Shell Dlg;
+ font-size: 10px;
+ }
+ TH {
+ font-family: MS Shell Dlg;
+ font-size: 10px;
+ font-style: normal;
+ text-decoration: none;
+ text-align: left;
+ line-height: 22px;
+ background-color: ActiveCaption;
+ color: CaptionText;
+ }
+ H1 {
+ font-family: Serife, Verdana, Helvetica, Arial, Tahoma;
+ font-size: 24px;
+ }
+ H2 {
+ font-family: Serife, Verdana, Helvetica, Arial, Tahoma;
+ font-size: 20px;
+ }
+ H3 {
+ font-family: Serife, Verdana, Helvetica, Arial, Tahoma;
+ font-size: 18px;
+ }
+ H4 {
+ font-family: Serife, Verdana, Helvetica, Arial, Tahoma;
+ font-size: 13px;
+ }
+ A {
+ color: blue;
+ }
+ IFRAME {
+ border-left:0px;
+ border-right:0px;
+ border-top:1px solid;
+ border-top-color: ActiveBorder;
+ border-bottom:1px solid;
+ border-bottom-color: ActiveBorder;
+ }
+ .hide {
+ display: none;
+ visibility: hidden;
+ }
+ .show {
+ display: block;
+ visibility: visible;
+ }
+ </STYLE>
+ <SCRIPT language="JScript">
+
+ function pageOnLoad()
+ {
+ window.returnValue = null;
+ setTimeout("onTimeout()", 10000);
+ return true;
+ }
+
+ function onTimeout()
+ {
+ window.returnValue = "TIMEOUT";
+ window.close();
+ }
+ </SCRIPT>
+</HEAD>
+<BODY scroll="no" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"
+ marginwidth="0" marginheight="0" onload="pageOnLoad(); return true;">
+<DIV style="position:absolute; top:0px; left:0px; width=505px; height:360px; border:0px solid;">
+<IMG src="PNG/IMG_JBOSPLASH" border="0" onclick="onTimeout(); return true;"/>
+</DIV>
+</DIV>
+</BODY>
+</HTML>
Modified: trunk/build/install/installer/sinstall.rc
===================================================================
--- trunk/build/install/installer/sinstall.rc 2008-04-07 14:27:14 UTC (rev 1529)
+++ trunk/build/install/installer/sinstall.rc 2008-04-07 15:43:50 UTC (rev 1530)
@@ -52,10 +52,12 @@
IMG_REDHAT32 PNG "res/redhat32.png"
IMG_REDHAT16 PNG "res/redhat16.png"
IMG_JBOSSTOP PNG "res/jbosstop.png"
+IMG_JBOSPLASH PNG "res/jbrhorg.png"
HTML_LGPLMAIN HTML "res/lgplmain.htm"
HTML_LGPL HTML "res/lgpl.htm"
HTML_EULAMAIN HTML "res/eulamain.htm"
HTML_EULA HTML "res/eula.htm"
+HTML_SPLASH HTML "res/splash.htm"
IDD_ABOUTBOX DIALOGEX 0, 0, 337, 187
STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
16 years, 9 months
JBoss Native SVN: r1529 - trunk/build/install/installer.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 10:27:14 -0400 (Mon, 07 Apr 2008)
New Revision: 1529
Modified:
trunk/build/install/installer/main.c
Log:
Allow config embedding in exe
Modified: trunk/build/install/installer/main.c
===================================================================
--- trunk/build/install/installer/main.c 2008-04-07 12:55:55 UTC (rev 1528)
+++ trunk/build/install/installer/main.c 2008-04-07 14:27:14 UTC (rev 1529)
@@ -51,6 +51,160 @@
static LPCSTR CMD_QUOTE = " &()[]{}^=;!'+,`~";
static LPSTR ppUnizpArgs[] = { "unzip", "-qq", "-d", NULL, NULL };
+#define EMBED_SIZE 2048
+#define EMBED_MAX 2044
+
+typedef struct {
+ char s_signature[16];
+ char s_class[EMBED_SIZE];
+ char s_flags[32];
+ UINT32 s_iopts[4];
+ char e_signature[16];
+} st_config;
+
+static BYTE c_signature[] = {
+ 's', 't', 'a', 'r', 't', 'u', 's', 'e', 'r', 's', 'b', 'l', 'o', 'c', 'k', '\0'
+};
+
+/* space in exe stub for user configuration */
+static BYTE conf_in_exe[EMBED_SIZE + 64] = {
+ 'S', 'T', 'A', 'R', 'T', 'U', 'S', 'E', 'R', 'S', 'B', 'L', 'O', 'C', 'K', '\0',
+
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+
+ '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
+ 'E', 'N', 'D', 'O', 'F', 'U', 'S', 'E', 'R', 'S', 'B', 'L', 'O', 'C', 'K', '\0',
+};
+
+static st_config *pConfig = NULL;
+
BOOL opt_Quiet = FALSE;
BOOL opt_Verbose = FALSE;
@@ -69,9 +223,11 @@
#define LNGOPT '.'
#define EMSG ""
-static LPSTR szProgramName = NULL;
-static LPSTR szProgramPath = NULL;
-static LPSTR szTempPath = NULL;
+static LPSTR szProgramName = NULL;
+static LPSTR szProgramPath = NULL;
+static LPSTR szProgramExe = NULL;
+static LPSTR szTempPath = NULL;
+static HANDLE hStub = NULL;
static int c_errno_table[] = {
@@ -371,11 +527,11 @@
if (szProgramName)
return szProgramName;
- szProgramPath = (LPSTR)calloc(1, MAX_PATH);
+ szProgramPath = (LPSTR)x_malloc(MAX_PATH);
if (!GetModuleFileNameExA(GetCurrentProcess(), NULL,
szProgramPath, MAX_PATH))
exit(GetLastError());
-
+ szProgramExe = x_strdup(szProgramPath);
if ((p = strrchr(szProgramPath, '\\')))
*(p++) = '\0';
else
@@ -422,7 +578,7 @@
if (!GetModuleFileNameExA(GetCurrentProcess(), NULL,
szProgramPath, MAX_PATH))
exit(GetLastError());
-
+ szProgramExe = x_strdup(szProgramPath);
if ((p = strrchr(szProgramPath, '\\')))
*(p++) = '\0';
else
@@ -739,6 +895,79 @@
return rv;
}
+static INT
+AplMemCmp(LPCVOID lpA, LPCVOID lpB, SIZE_T nBytes)
+{
+ if (nBytes != 0) {
+ const BYTE *p1 = lpA, *p2 = lpB;
+
+ do {
+ if (*p1++ != *p2++)
+ return (*--p1 - *--p2);
+ } while (--nBytes != 0);
+ }
+ return 0;
+}
+
+/*
+ * Find the first occurrence of lpFind in lpMem.
+ * dwLen: The length of lpFind
+ * dwSize: The length of lpMem
+ */
+static LPBYTE
+ApcMemSearch(LPCVOID lpMem, LPCVOID lpFind, SIZE_T dwLen, SIZE_T dwSize)
+{
+ BYTE c, sc;
+ SIZE_T cnt = 0;
+ const BYTE *s = lpMem, *find = lpFind;
+
+ if ((c = *find++) != 0) {
+ do {
+ do {
+ sc = *s++;
+ if (cnt++ > dwSize)
+ return NULL;
+ } while (sc != c);
+ } while (AplMemCmp(s, find, dwLen - 1) != 0);
+ s--;
+ }
+ return (LPBYTE)s;
+}
+
+
+/* Merge the stub with jar file
+ * Fix the userblock bounded code.
+ */
+static BOOL MergeConfig(size_t slen)
+{
+ HANDLE hmap;
+ BOOL rv = FALSE;
+ BYTE bmatch[16];
+
+ BYTE *map, *ss;
+ int i;
+ if ((hmap = CreateFileMapping(hStub, NULL,
+ PAGE_READWRITE, 0, 0, NULL)) == NULL) {
+ x_perror(0, "Mapping Stub");
+ }
+ if ((map = MapViewOfFile(hmap, FILE_MAP_ALL_ACCESS, 0, 0, 0)) == NULL) {
+ x_perror(0, "Mapping Stub View");
+ }
+ /* convert to upper case */
+ for (i = 0; i < 15; i++)
+ bmatch[i] = c_signature[i] - 32;
+ bmatch[15] = 0;
+ if ((ss = ApcMemSearch(map, bmatch, 16, slen)) != NULL) {
+ st_config cfg;
+ memcpy(&cfg, ss, sizeof(st_config));
+ memcpy(ss, pConfig, sizeof(st_config));
+ rv = TRUE;
+ }
+ UnmapViewOfFile(map);
+ CloseHandle(hmap);
+ return rv;
+}
+
static void ExitCleanup(void)
{
static int cleanup = 0;
@@ -785,13 +1014,21 @@
#endif
int r, ch;
int ap = 1;
+ BOOL bRunScript;
+ BOOL bMakeTemp;
+ BOOL bShowSplash;
+ BOOL bShowLicense;
+ BOOL selectDest;
+ DWORD dwWinTimeout;
+ DWORD dwSplTimeout;
+ BOOL bMerge = FALSE;
+
+ LPSTR szCmdLine = NULL;
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 };
+ CHAR szDest[MAX_PATH] = { 0, 0 };
LPSTR szHtmlPage = NULL;
LPSTR szHtmlTitle = NULL;
@@ -799,17 +1036,28 @@
LPSTR szHtmlResult = NULL;
DWORD dwHtmlWidth = DEF_WWIDTH;
DWORD dwHtmlHeight = DEF_WHEIGHT;
- DWORD dwWinTimeout = INFINITE;
DWORD dwFlags = 0;
+ LPCSTR szEulaPage = "/HTML_EULAMAIN";
PROCESS_INFORMATION prInfo;
- LPCSTR szEulaPage = "/HTML_EULAMAIN";
atexit(ExitCleanup);
+ pConfig = (st_config *)conf_in_exe;
+ /* Read defaults from embedded config
+ */
+ bRunScript = pConfig->s_flags[0];
+ bMakeTemp = pConfig->s_flags[1];
+ selectDest = pConfig->s_flags[2];
+ opt_Verbose = pConfig->s_flags[3];
+ bShowSplash = pConfig->s_flags[4];
+ bShowLicense = pConfig->s_flags[5];
+ dwWinTimeout = pConfig->s_iopts[0];
+ dwSplTimeout = pConfig->s_iopts[1];
+
if (!GuiInitialize()) {
exit(-1);
}
- while ((ch = getopt(__argc, __argv, "aAd:f:gh:n:p:qQr:st:vVw:")) != EOF) {
+ while ((ch = getopt(__argc, __argv, "aAd:f:gh:len:p:qQr:s:S:t:T:uvVw:x")) != EOF) {
switch (ch) {
case 'A':
case 'a':
@@ -836,14 +1084,17 @@
szEulaPage = "/HTML_LGPLMAIN";
break;
case 'd':
- if (*optarg != '~') {
+ if (*optarg == '~') {
+ szDest[0] = '~';
+ selectDest = FALSE;
+ }
+ if (*optarg == '?') {
+ selectDest = TRUE;
+ }
+ else {
if (x_fullpath(optarg, szDest))
selectDest = FALSE;
}
- else {
- szDest[0] = '~';
- selectDest = FALSE;
- }
break;
case 'n':
szHtmlTitle = x_strdup(optarg);
@@ -852,8 +1103,13 @@
szHtmlPage = x_fullpath(optarg, NULL);
break;
case 's':
- dwFlags = 1;
+ bShowSplash = TRUE;
+ dwSplTimeout = (DWORD)atoi(optarg);
break;
+ case 'S':
+ bShowSplash = TRUE;
+ dwSplTimeout = (DWORD)atoi(optarg) * 1000;
+ break;
case 'f':
szHtmlResult = x_fullpath(optarg, NULL);
break;
@@ -864,15 +1120,30 @@
szHtmlParams[l] = '\t';
}
break;
+ case 'l':
+ bShowLicense = TRUE;
+ break;
+ case 'e':
+ bMerge = TRUE;
+ break;
case 't':
dwWinTimeout = (DWORD)atoi(optarg);
break;
+ case 'T':
+ dwWinTimeout = (DWORD)atoi(optarg) * 1000;
+ break;
case 'w':
dwHtmlWidth = (DWORD)atoi(optarg);
break;
case 'h':
dwHtmlHeight = (DWORD)atoi(optarg);
break;
+ case 'u':
+ bMakeTemp = FALSE;
+ break;
+ case 'x':
+ bRunScript = TRUE;
+ break;
case '?':
r = EINVAL;
goto cleanup;
@@ -882,6 +1153,34 @@
__argc -= optind;
__argv += optind;
+ if (dwWinTimeout == 0)
+ dwWinTimeout = INFINITE;
+
+ if (bMerge) {
+ BY_HANDLE_FILE_INFORMATION si;
+ if (__argc < 1) {
+ x_perror(EINVAL, "Missing Argument");
+ }
+ GetProgramName();
+ if ((hStub = CreateFile(__argv[0], GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
+ NULL)) == INVALID_HANDLE_VALUE) {
+ x_perror(0, szProgramExe);
+ }
+ /* Get original stub size */
+ GetFileInformationByHandle(hStub, &si);
+ pConfig->s_flags[0] = bRunScript;
+ pConfig->s_flags[1] = bMakeTemp;
+ pConfig->s_flags[2] = selectDest;
+ pConfig->s_flags[3] = opt_Verbose;
+ pConfig->s_flags[4] = bShowSplash;
+ pConfig->s_flags[5] = bShowLicense;
+ pConfig->s_iopts[0] = dwWinTimeout;
+ pConfig->s_iopts[1] = dwSplTimeout;
+ r = MergeConfig(si.nFileSizeLow);
+ CloseHandle(hStub);
+ goto cleanup;
+ }
if (szHtmlPage) {
if (!szHtmlTitle) {
r = EINVAL;
@@ -907,7 +1206,7 @@
}
/* Standard Install */
- if (!opt_Quiet && !AcceptLicensePage(szEulaPage)) {
+ if (bShowLicense && !AcceptLicensePage(szEulaPage)) {
r = EPERM;
goto cleanup;
}
@@ -919,7 +1218,7 @@
goto cleanup;
}
}
- if (szDest[0] != '~' && access(szDest, 06)) {
+ if (szDest[0] && szDest[0] != '~' && access(szDest, 06)) {
if (errno == ENOENT) {
char msg[MAX_PATH + 64];
sprintf(msg, GuiLoadResource(IDS_NDIRMSG, 0),
@@ -955,12 +1254,23 @@
x_perror(0, "System Directory");
}
- if (!(szTempPath = x_mktemp(NULL, 0))) {
- x_perror(EPERM, "Creating Temp directory");
+ if (bMakeTemp) {
+ if (!(szTempPath = x_mktemp(NULL, 0))) {
+ x_perror(EPERM, "Creating Temp directory");
+ }
+ strcpy(szWorkDir, szTempPath);
+ strcat(szWorkDir, DIR_BATCH);
+ ppUnizpArgs[3] = szTempPath;
}
- strcpy(szWorkDir, szTempPath);
- strcat(szWorkDir, DIR_BATCH);
- ppUnizpArgs[3] = szTempPath;
+ else {
+ if (szDest[0] && szDest[0] != '~')
+ ppUnizpArgs[3] = szDest;
+ else {
+ /* Nothing to do */
+ r = 0;
+ goto cleanup;
+ }
+ }
if (opt_Verbose) {
fprintf(stdout, "Running main: %s\n", szTempPath);
}
@@ -972,17 +1282,18 @@
x_perror(EINVAL, "Uncompressing");
}
DESTROYGLOBALS();
- szCmdLine = BuildCommandLine(szCmdExe,
- CMD_BATCH,
- CMD_PARAM,
- szDest,
- NULL);
- if (RunChildProcess(szCmdExe, szCmdLine, szWorkDir, &prInfo)) {
-
- r = 0;
+ if (bRunScript) {
+ szCmdLine = BuildCommandLine(szCmdExe,
+ CMD_BATCH,
+ CMD_PARAM,
+ szDest,
+ NULL);
+ if (RunChildProcess(szCmdExe, szCmdLine, szWorkDir, &prInfo)) {
+ r = 0;
+ }
+ else
+ r = GetLastError();
}
- else
- r = GetLastError();
#if 0
GuiOkMessage(NULL,
"Continue",
16 years, 9 months
JBoss Native SVN: r1528 - trunk/build/install/installer.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 08:55:55 -0400 (Mon, 07 Apr 2008)
New Revision: 1528
Removed:
trunk/build/install/installer/licenses/
Log:
We have info-zip license inside root licenses dir
16 years, 9 months
JBoss Native SVN: r1527 - trunk/build/install/nawk.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 08:48:36 -0400 (Mon, 07 Apr 2008)
New Revision: 1527
Added:
trunk/build/install/nawk/NMAKEmakefile
Modified:
trunk/build/install/nawk/nawk.exe
Log:
Add standard NMAKEmakefile
Added: trunk/build/install/nawk/NMAKEmakefile
===================================================================
--- trunk/build/install/nawk/NMAKEmakefile (rev 0)
+++ trunk/build/install/nawk/NMAKEmakefile 2008-04-07 12:48:36 UTC (rev 1527)
@@ -0,0 +1,99 @@
+# Copyright(c) 2006 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+
+!IF !DEFINED(TARGET) || "$(TARGET)" == ""
+TARGET = EXE
+!ENDIF
+PROJECT = nawk
+!include <..\..\NMAKEcommon.inc>
+
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .
+!ENDIF
+
+YACC = bison -y
+YFLAGS = -d
+
+LFLAGS = $(LFLAGS) /version:2008.3
+
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+ $(WORKDIR)\b.obj \
+ $(WORKDIR)\main.obj \
+ $(WORKDIR)\parse.obj \
+ $(WORKDIR)\proctab.obj \
+ $(WORKDIR)\tran.obj \
+ $(WORKDIR)\lib.obj \
+ $(WORKDIR)\run.obj \
+ $(WORKDIR)\missing95.obj \
+ $(WORKDIR)\ytab.obj \
+ $(WORKDIR)\lex.obj
+
+OBJDEPS = $(SRCDIR)\*.h \
+ NMAKEmakefile
+
+BUILDLOC = $(PREFIX)\bin
+BUILDEXE = $(WORKDIR)\$(PROJECT).exe
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMAN = $(BUILDEXE).manifest
+
+all : $(WORKDIR) $(BUILDEXE)
+
+$(BUILDLOC) :
+ @if not exist "$(BUILDLOC)\$(NULL)" mkdir "$(BUILDLOC)"
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+{$(SRCDIR)}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+$(BUILDRES): $(SRCDIR)/$(PROJECT).rc
+ $(RC) $(RCFLAGS) /i "$(SRCDIR)" /fo $(BUILDRES) $(SRCDIR)/$(PROJECT).rc
+
+$(OBJECTS): $(OBJDEPS)
+
+proctab.c: maketab.exe
+ maketab.exe >proctab.c
+
+awkgram.h: awk.h proto.h awkgram.y
+ $(YACC) $(YFLAGS) awkgram.y
+ copy y.tab.c ytab.c
+ del y.tab.c
+ copy y.tab.h awkgram.h
+ del y.tab.h
+
+maketab.exe: awkgram.h maketab.obj
+ $(LINK) $(LFLAGS) maketab.obj $(LIBS)
+
+$(BUILDEXE): $(WORKDIR) $(OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) $(LDIRS) /pdb:$(BUILDPDB) /out:$(BUILDEXE)
+ IF EXIST $(BUILDMAN) \
+ mt -nologo -manifest $(BUILDMAN) -outputresource:$(BUILDEXE);1
+
+clean:
+ @$(CLEANTARGET)
+
+install: $(BUILDLOC) $(WORKDIR) $(BUILDEXE)
+ @xcopy "$(WORKDIR)\*.exe" "$(BUILDLOC)" /Y /Q
Property changes on: trunk/build/install/nawk/NMAKEmakefile
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/build/install/nawk/nawk.exe
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Native SVN: r1526 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 08:04:48 -0400 (Mon, 07 Apr 2008)
New Revision: 1526
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add tools descriptions
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-07 11:55:16 UTC (rev 1525)
+++ trunk/build/install/xtool/xtool.c 2008-04-07 12:04:48 UTC (rev 1526)
@@ -3344,6 +3344,12 @@
"touch", "Change file timestamps",
"exec", "Execute program",
"mktemp", "Make temporary filename (unique)",
+ "image", "Executable image information",
+ "html", "Display html page",
+ "reg", "Registry tool",
+ "msg", "Display MessageBox",
+ "jdk", "Find JDK/JRE location",
+ "dir", "Browse for File or Folder",
NULL, NULL
};
16 years, 9 months
JBoss Native SVN: r1525 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 07:55:16 -0400 (Mon, 07 Apr 2008)
New Revision: 1525
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add Browse For Folder GUI Tool
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-07 10:38:16 UTC (rev 1524)
+++ trunk/build/install/xtool/xtool.c 2008-04-07 11:55:16 UTC (rev 1525)
@@ -2923,7 +2923,8 @@
GuiBrowseForFolder(
HWND hWnd,
LPCSTR szTitle,
- LPSTR szPath)
+ LPSTR szPath,
+ int iFlags)
{
BOOL rv = FALSE;
@@ -2937,7 +2938,7 @@
bi.lpszTitle = szTitle;
bi.pszDisplayName = szPath;
bi.hwndOwner = hWnd;
- bi.ulFlags = BIF_USENEWUI;
+ bi.ulFlags = iFlags;
bi.pidlRoot = il;
if ((ir = SHBrowseForFolder(&bi)) != NULL) {
@@ -3578,6 +3579,16 @@
return retval;
}
+static int prog_browse_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... TITLE\n", progname);
+ fprintf(stderr, "Browse for Folders (or Files)\n\n");
+ fprintf(stderr, " -f Show Files as well.\n");
+ fprintf(stderr, " -r Read-only. Do not show New Folder button.\n\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -5054,6 +5065,9 @@
int modal = MB_TASKMODAL;
char *p, *msg = NULL;
+ if (!GuiInitialize()) {
+ return x_perror(0, "Windows GUI");
+ }
while ((ch = getopt(argc, argv, "i:st:hqvV", 0)) != EOF) {
switch (ch) {
case '.':
@@ -5161,7 +5175,7 @@
*(p++) = '\n';
}
}
- rv = MessageBoxA(NULL, msg, argv[0], type | icon | modal);
+ rv = MessageBoxA(HWND_DESKTOP, msg, argv[0], type | icon | modal);
x_free(msg);
if (rv == 0)
rv = -1;
@@ -5397,6 +5411,73 @@
return rv;
}
+static int prog_browse(int argc, const char **argv, const char **env)
+{
+ int ch, rv = 0;
+ int flags = BIF_USENEWUI;
+ char *p, *msg = NULL;
+ char path[MAX_PATH] = { 0 };
+
+ if (!GuiInitialize()) {
+ return x_perror(0, "Windows GUI");
+ }
+ while ((ch = getopt(argc, argv, "frhqvV", 0)) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!stricmp(optarg, "verbose"))
+ xtrace = 1;
+ else if (!stricmp(optarg, "version"))
+ return print_banner(1);
+ else if (!stricmp(optarg, "help"))
+ return prog_browse_usage(0);
+ else
+ return prog_browse_usage(EINVAL);
+ break;
+ case 'v':
+ xtrace = 1;
+ break;
+ case 'V':
+ xtrace = 9;
+ break;
+ case 'q':
+ xquiet = 1;
+ break;
+ case 'h':
+ return prog_browse_usage(0);
+ break;
+ case 'r':
+ flags &= ~(BIF_USENEWUI);
+ break;
+ case 'f':
+ flags |= BIF_BROWSEINCLUDEFILES;
+ break;
+ case '?':
+ case ':':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 1) {
+ return prog_browse_usage(EINVAL);
+ }
+ msg = x_strdup(argv[0]);
+ for (p = msg; *p; p++) {
+ if (*p == '\\' && *(p + 1) == 'n') {
+ *(p++) = '\r';
+ *(p++) = '\n';
+ }
+ }
+ if (GuiBrowseForFolder(HWND_DESKTOP, msg, path, flags)) {
+ fputs(path, stdout);
+ }
+ else
+ rv = 1;
+ x_free(msg);
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -5422,6 +5503,7 @@
{ "reg", prog_reg },
{ "msg", prog_msg },
{ "jdk", prog_jdk },
+ { "dir", prog_browse },
{ NULL, NULL }
};
@@ -5477,8 +5559,6 @@
xtools_pause = 1;
if ((e = getenv("XTOOLS_VERBOSE")) != NULL) {
xtrace = atoi(e);
- if (!xtrace)
- xtrace = 1;
}
}
@@ -5544,12 +5624,12 @@
x_free(modname);
setup_env(env);
rv = umain(argc, argv, env);
- if (xtools_pause) {
+ if (!xquiet && xtools_pause) {
fprintf(stdout, "\nPress any key to continue...");
getch();
fprintf(stdout, "\n");
}
- if (xtrace)
+ if (xtrace > 1)
warnx("exit(%d)", rv);
exit(rv);
/*
16 years, 9 months
JBoss Native SVN: r1524 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 06:38:16 -0400 (Mon, 07 Apr 2008)
New Revision: 1524
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add JDK/JRE detection tool
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-07 09:11:13 UTC (rev 1523)
+++ trunk/build/install/xtool/xtool.c 2008-04-07 10:38:16 UTC (rev 1524)
@@ -512,12 +512,16 @@
char *cp, *argp, *res;
size_t saved_lengths[MAX_SAVED_LENGTHS];
int nargs = 0;
+ size_t len;
+ va_list adummy;
/* Pass one --- find length of required string */
- size_t len = strlen(str);
- va_list adummy;
+ if (!str)
+ return NULL;
+
+ len = strlen(str);
va_start(adummy, str);
saved_lengths[nargs++] = len;
while ((cp = va_arg(adummy, char *)) != NULL) {
@@ -1592,7 +1596,27 @@
return rv;
}
+static char *x_getenv(const char *str)
+{
+ wchar_t ibuf[256];
+ wchar_t ebuf[INFO_BUFFER_SIZE];
+ char *rv = NULL;
+ if (MultiByteToWideChar(CP_UTF8, 0, str, -1, ibuf, 256)) {
+ DWORD el = GetEnvironmentVariableW(ibuf, ebuf,
+ INFO_BUFFER_SIZE);
+ if (el > INFO_BUFFER_SIZE) {
+ if (xtrace)
+ warnx("expansion string to large %d", el);
+ }
+ else if (el) {
+ rv = x_strdup_utf8(ebuf);
+ }
+ }
+ return rv;
+}
+
+
/* This is the helper code to resolve late bound entry points
* missing from one or more releases of the Win32 API
*/
@@ -2404,8 +2428,8 @@
}
k->sam = reg_flags(sam);
- if ((i = RegOpenKeyExW(r, k->name, 0, k->sam, &k->key))
- != ERROR_SUCCESS) {
+ if ((i = RegOpenKeyExW(r, k->name, 0,
+ k->sam, &k->key)) != ERROR_SUCCESS) {
i = x_cerror(i);
x_free(k);
errno = i;
@@ -2446,8 +2470,8 @@
errno = EINVAL;
return errno;
}
- if ((i = RegOpenKeyExW(r, k.name, 0, k.sam, &k.key))
- != ERROR_SUCCESS) {
+ if ((i = RegOpenKeyExW(r, k.name, 0,
+ k.sam, &k.key)) != ERROR_SUCCESS) {
errno = x_cerror(i);
return errno;
}
@@ -3536,6 +3560,24 @@
return retval;
}
+static int prog_jdk_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... [PATH]\n", progname);
+ fprintf(stderr, "Find java SDK or JRE paths\n\n");
+ fprintf(stderr, " -e Use environment variable.\n");
+ fprintf(stderr, " -E STRING Use environment variable instead JAVA_HOME.\n");
+ fprintf(stderr, " -j Find JRE insted of JDK.\n");
+ fprintf(stderr, " -d Find jvm.dll insted location.\n");
+ fprintf(stderr, " -s Favor server JRE version.\n");
+ fprintf(stderr, " -r STRING Registry access mode.\n");
+ fprintf(stderr, " a all access\n");
+ fprintf(stderr, " r read access\n");
+ fprintf(stderr, " 32 operate on the 32-bit registry view\n");
+ fprintf(stderr, " 64 operate on the 64-bit registry view\n\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -4686,7 +4728,7 @@
if (!GuiInitialize()) {
return x_perror(0, "Windows GUI");
}
- while ((ch = getopt(argc, argv, "g:n:o:p:st:T:qhqv", 1)) != EOF) {
+ while ((ch = getopt(argc, argv, "g:n:o:p:st:T:qhqv", 0)) != EOF) {
switch (ch) {
case '.':
if (!stricmp(optarg, "verbose"))
@@ -4821,7 +4863,7 @@
int rt = REG_NONE;
x_registry_t *reg = NULL;
- while ((ch = getopt(argc, argv, "ad:f:m:r:t:hqvV", 1)) != EOF) {
+ while ((ch = getopt(argc, argv, "ad:f:m:r:t:hqvV", 0)) != EOF) {
switch (ch) {
case '.':
if (!stricmp(optarg, "verbose"))
@@ -5011,7 +5053,8 @@
int icon = MB_ICONQUESTION;
int modal = MB_TASKMODAL;
char *p, *msg = NULL;
- while ((ch = getopt(argc, argv, "i:st:hqvV", 1)) != EOF) {
+
+ while ((ch = getopt(argc, argv, "i:st:hqvV", 0)) != EOF) {
switch (ch) {
case '.':
if (!stricmp(optarg, "verbose"))
@@ -5125,6 +5168,235 @@
return rv;
}
+static const char *jvm_paths[] = {
+ "\\server\\jvm.dll",
+ "\\client\\jvm.dll",
+ "\\jrockit\\jvm.dll",
+ "\\server\\jvm.dll",
+ NULL
+};
+
+static const char *jdk_keys[] = {
+ "HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit",
+ "HKLM\\SOFTWARE\\JRockit\\Java Development Kit",
+ NULL
+};
+
+static const char *jre_keys[] = {
+ "HKLM\\SOFTWARE\\JavaSoft\\Java Runtime Environment",
+ "HKLM\\SOFTWARE\\JRockit\\Java Runtime Environment",
+ NULL
+};
+
+static int prog_jdk(int argc, const char **argv, const char **env)
+{
+ int i, ch, rv = 0;
+ int useenv = 0;
+ int server = 0;
+ int getjre = 0;
+ int jredll = 0;
+ char *penv = NULL;
+ char *home = NULL;
+ char *jred = NULL;
+ char *jbin = NULL;
+ char *jreh = NULL;
+ char *regm = NULL;
+
+ while ((ch = getopt(argc, argv, "deE:r:jshqvV", 0)) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!stricmp(optarg, "verbose"))
+ xtrace = 1;
+ else if (!stricmp(optarg, "version"))
+ return print_banner(1);
+ else if (!stricmp(optarg, "help"))
+ return prog_jdk_usage(0);
+ else
+ return prog_jdk_usage(EINVAL);
+ break;
+ case 'v':
+ xtrace = 1;
+ break;
+ case 'V':
+ xtrace = 9;
+ break;
+ case 'q':
+ xquiet = 1;
+ break;
+ case 'h':
+ return prog_jdk_usage(0);
+ break;
+ case 'e':
+ useenv = 1;
+ break;
+ case 'E':
+ useenv = 1;
+ penv = x_strdup(optarg);
+ break;
+ case 'r':
+ regm = x_strdup(optarg);
+ break;
+ case 's':
+ server = 1;
+ break;
+ case 'j':
+ getjre = 1;
+ break;
+ case 'd':
+ jredll = 1;
+ break;
+ case '?':
+ case ':':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc > 0) {
+ home = x_fullpath(argv[0]);
+ printf("Home is %s\n", home);
+ }
+ if (useenv) {
+ const char *senv = NULL;
+ if (home) {
+ if (getjre) {
+ jreh = x_strdup(home);
+ }
+ }
+ else if (penv) {
+ senv = penv;
+ home = x_getenv(senv);
+ }
+ else if (getjre) {
+ senv = "JRE_HOME";
+ if (!(home = x_getenv(senv))) {
+ senv = "JAVA_HOME";
+ home = x_getenv(senv);
+ if (home) {
+ size_t l = strlen(home);
+ if (home[l - 1] == '\\' ||
+ home[l - 1] == '/')
+ home[l - 1] = '\0';
+ jreh = x_strvcat(home, "\\jre", NULL);
+ x_free(home);
+ home = x_strdup(jreh);
+ }
+ }
+ else {
+ jreh = x_strdup(home);
+ }
+ }
+ else {
+ senv = "JAVA_HOME";
+ home = x_getenv(senv);
+ }
+ if (home) {
+ size_t l = strlen(home);
+ if (home[l - 1] == '\\' ||
+ home[l - 1] == '/')
+ home[l - 1] = '\0';
+ jbin = x_strvcat(home, "\\bin", NULL);
+ if (!x_fattrib(jbin)) {
+ rv = x_perror(ENOTDIR, jbin);
+ goto cleanup;
+ }
+ if (!jreh)
+ jreh = x_strvcat(home, "\\jre", NULL);
+ if (!x_fattrib(jreh)) {
+ rv = x_perror(ENOTDIR, jreh);
+ goto cleanup;
+ }
+ }
+ else {
+ rv = x_perror(ENOENT, senv);
+ goto cleanup;
+ }
+ if (xtrace > 1) {
+ warnx("JDK %s", home);
+ warnx("JRE %s", jreh);
+ warnx("BIN %s", jbin);
+ }
+ }
+ else {
+ x_registry_t *reg = NULL;
+ const char **keys;
+ if (getjre)
+ keys = jre_keys;
+ else
+ keys = jdk_keys;
+ for (i = 0; keys[i]; i++) {
+ if ((reg = reg_open(keys[i], regm ? regm : "r"))) {
+ char *cv = reg_value(reg, "CurrentVersion", 0);
+ if (cv) {
+ char *ck = x_strvcat(keys[i], "\\", cv, NULL);
+ reg_close(reg);
+ if ((reg = reg_open(ck, regm ? regm : "r"))) {
+ home = reg_value(reg, "JavaHome", 0);
+ if (home) {
+ size_t l = strlen(home);
+ if (home[l - 1] == '\\' ||
+ home[l - 1] == '/')
+ home[l - 1] = '\0';
+ if (getjre) {
+ jreh = x_strdup(home);
+ jred = reg_value(reg, "RuntimeLib", 0);
+ }
+ else {
+ jreh = x_strvcat(home, "\\jre", NULL);
+ jbin = x_strvcat(jreh, "\\bin", NULL);
+ }
+ }
+ }
+ x_free(ck);
+ }
+ x_free(cv);
+ }
+ reg_close(reg);
+ if (home)
+ break;
+ }
+ if (!home) {
+ rv = x_perror(ENOENT, "JavaHome Registry search");
+ goto cleanup;
+ }
+ }
+ if (jredll && jbin) {
+ if (server)
+ i = 0;
+ else
+ i = 1;
+ for (; jvm_paths[i]; i++) {
+ jred = x_strvcat(jbin, jvm_paths[i], NULL);
+ if (x_fattrib(jred))
+ break;
+ x_free(jred);
+ jred = NULL;
+ }
+ if (!jred) {
+ rv = x_perror(ENOENT, "jvm.dll");
+ goto cleanup;
+ }
+ }
+
+cleanup:
+ if (rv == 0) {
+ if (jred) {
+ fputs(jred, stdout);
+ }
+ else if (home)
+ fputs(home, stdout);
+ fflush(stdout);
+ }
+ x_free(regm);
+ x_free(jreh);
+ x_free(jbin);
+ x_free(jred);
+ x_free(home);
+ x_free(penv);
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -5149,6 +5421,7 @@
{ "html", prog_html },
{ "reg", prog_reg },
{ "msg", prog_msg },
+ { "jdk", prog_jdk },
{ NULL, NULL }
};
16 years, 9 months
JBoss Native SVN: r1523 - in sandbox/httpd/src/native: mod_proxy_cluster and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-04-07 05:11:13 -0400 (Mon, 07 Apr 2008)
New Revision: 1523
Modified:
sandbox/httpd/src/native/mod_manager/mod_manager.c
sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Remove useless defines.
Modified: sandbox/httpd/src/native/mod_manager/mod_manager.c
===================================================================
--- sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-04-07 07:41:55 UTC (rev 1522)
+++ sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-04-07 09:11:13 UTC (rev 1523)
@@ -15,8 +15,6 @@
#include "apr_strings.h"
#include "apr_lib.h"
-#define CORE_PRIVATE
-
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
Modified: sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-04-07 07:41:55 UTC (rev 1522)
+++ sandbox/httpd/src/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-04-07 09:11:13 UTC (rev 1523)
@@ -27,8 +27,6 @@
#include "apr_strings.h"
-#define CORE_PRIVATE
-
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
16 years, 9 months
JBoss Native SVN: r1522 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 03:41:55 -0400 (Mon, 07 Apr 2008)
New Revision: 1522
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add MessageBox tool
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-07 06:52:39 UTC (rev 1521)
+++ trunk/build/install/xtool/xtool.c 2008-04-07 07:41:55 UTC (rev 1522)
@@ -3453,7 +3453,7 @@
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");
+ fprintf(stderr, " -P Product Version (from Resource).\n\n");
print_stdusage();
return retval;
}
@@ -3496,11 +3496,46 @@
fprintf(stderr, " REG_DWORD\n");
fprintf(stderr, " REG_QWORD\n");
fprintf(stderr, " -f CHAR Field separator for REG_MULTI_SZ.\n");
- fprintf(stderr, " -d STRING Data to be used for add operation.\n");
+ fprintf(stderr, " -d STRING Data to be used for add operation.\n\n");
print_stdusage();
return retval;
}
+static int prog_msg_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... CAPTION TEXT\n", progname);
+ fprintf(stderr, "Display message box\n\n");
+ fprintf(stderr, " -s System-modal message box.\n");
+ fprintf(stderr, " -t STRING Message box type:\n");
+ fprintf(stderr, " MB_ABORTRETRYIGNORE\n");
+ fprintf(stderr, " MB_CANCELTRYCONTINUE\n");
+ fprintf(stderr, " MB_HELP\n");
+ fprintf(stderr, " MB_OK\n");
+ fprintf(stderr, " MB_OKCANCEL\n");
+ fprintf(stderr, " MB_RETRYCANCEL\n");
+ fprintf(stderr, " MB_YESN\n");
+ fprintf(stderr, " MB_YESNOCANCEL\n");
+ fprintf(stderr, " -i CHAR Message box icon:\n");
+ fprintf(stderr, " '!' Exclamation-point icon appears in the message box\n");
+ fprintf(stderr, " 'w' Exclamation-point icon appears in the message box\n");
+ fprintf(stderr, " 'i' Letter i in a circle appears in the message box\n");
+ fprintf(stderr, " 's' Stop-sign icon appears in the message box\n\n");
+ fprintf(stderr, "Return value is set depending on the key pressed\n");
+ fprintf(stderr, " OK 1\n");
+ fprintf(stderr, " CANCEL 2\n");
+ fprintf(stderr, " ABORT 3\n");
+ fprintf(stderr, " RETRY 4\n");
+ fprintf(stderr, " IGNORE 5\n");
+ fprintf(stderr, " YES 6\n");
+ fprintf(stderr, " NO 7\n");
+ fprintf(stderr, " CLOSE 8\n");
+ fprintf(stderr, " HELP 9\n");
+ fprintf(stderr, " TRYAGAIN 10\n");
+ fprintf(stderr, " CONTINUE 11\n\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -4969,6 +5004,127 @@
return rv;
}
+static int prog_msg(int argc, const char **argv, const char **env)
+{
+ int ch, rv = 0;
+ int type = MB_YESNO;
+ int icon = MB_ICONQUESTION;
+ int modal = MB_TASKMODAL;
+ char *p, *msg = NULL;
+ while ((ch = getopt(argc, argv, "i:st:hqvV", 1)) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!stricmp(optarg, "verbose"))
+ xtrace = 1;
+ else if (!stricmp(optarg, "version"))
+ return print_banner(1);
+ else if (!stricmp(optarg, "help"))
+ return prog_msg_usage(0);
+ else
+ return prog_msg_usage(EINVAL);
+ break;
+ case 'v':
+ xtrace = 1;
+ break;
+ case 'V':
+ xtrace = 9;
+ break;
+ case 'q':
+ xquiet = 1;
+ break;
+ case 'h':
+ return prog_msg_usage(0);
+ break;
+ case 's':
+ modal = MB_SYSTEMMODAL;
+ break;
+ case 't':
+ if (!stricmp("yn", optarg) ||
+ !stricmp("MB_YESNO", optarg)) {
+ type = MB_YESNO;
+ }
+ else if (!stricmp("ync", optarg) ||
+ !stricmp("MB_YESNOCANCEL", optarg)) {
+ type = MB_YESNOCANCEL;
+ }
+ else if (!stricmp("ok", optarg) ||
+ !stricmp("MB_OK", optarg)) {
+ type = MB_OK;
+ }
+ else if (!stricmp("oc", optarg) ||
+ !stricmp("MB_OKCANCEL", optarg)) {
+ type = MB_OKCANCEL;
+ }
+ else if (!stricmp("ctc", optarg) ||
+ !stricmp("MB_CANCELTRYCONTINUE", optarg)) {
+ type = MB_CANCELTRYCONTINUE;
+ }
+ else if (!stricmp("ari", optarg) ||
+ !stricmp("MB_ABORTRETRYIGNORE", optarg)) {
+ type = MB_ABORTRETRYIGNORE;
+ }
+ else if (!stricmp("rc", optarg) ||
+ !stricmp("MB_RETRYCANCEL", optarg)) {
+ type = MB_RETRYCANCEL;
+ }
+ else {
+ return prog_msg_usage(EINVAL);
+ }
+ break;
+ case 'i':
+ switch (*optarg) {
+ case '!':
+ icon = MB_ICONEXCLAMATION;
+ break;
+ case 'w':
+ case 'W':
+ icon = MB_ICONWARNING;
+ break;
+ case 'i':
+ case 'I':
+ icon = MB_ICONINFORMATION;
+ break;
+ case '*':
+ icon = MB_ICONASTERISK;
+ break;
+ case '?':
+ icon = MB_ICONQUESTION;
+ break;
+ case 's':
+ case 'S':
+ icon = MB_ICONSTOP;
+ break;
+ case 'h':
+ case 'H':
+ icon = MB_ICONHAND;
+ break;
+ }
+ break;
+ case '?':
+ case ':':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 2) {
+ return prog_rmdir_usage(EINVAL);
+ }
+ msg = x_strdup(argv[1]);
+ for (p = msg; *p; p++) {
+ if (*p == '\\' && *(p + 1) == 'n') {
+ *(p++) = '\r';
+ *(p++) = '\n';
+ }
+ }
+ rv = MessageBoxA(NULL, msg, argv[0], type | icon | modal);
+ x_free(msg);
+ if (rv == 0)
+ rv = -1;
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -4992,6 +5148,7 @@
{ "coff", prog_image },
{ "html", prog_html },
{ "reg", prog_reg },
+ { "msg", prog_msg },
{ NULL, NULL }
};
16 years, 9 months
JBoss Native SVN: r1521 - trunk/build/install/xtool.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2008-04-07 02:52:39 -0400 (Mon, 07 Apr 2008)
New Revision: 1521
Modified:
trunk/build/install/xtool/xtool.c
Log:
Add registry tool similar to windows reg but which can operate on 64 bit registry views
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-04 16:22:22 UTC (rev 1520)
+++ trunk/build/install/xtool/xtool.c 2008-04-07 06:52:39 UTC (rev 1521)
@@ -191,12 +191,14 @@
* ---------------------------------------------------------------------
*/
-int utf8_to_unicode_path(wchar_t*, size_t, const char *, size_t);
-int unicode_to_utf8_path(char *, size_t, const wchar_t *);
-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 *);
+int utf8_to_unicode_path(wchar_t*, size_t, const char *, size_t);
+int unicode_to_utf8_path(char *, size_t, const wchar_t *);
+int utf8_to_unicode(wchar_t *, size_t, const char *);
+int unicode_to_utf8(char *, size_t, const wchar_t *);
+int x_wfullpath(wchar_t *, size_t, const char *);
+char *x_forwardslash(char *);
+
+
/*
* ---------------------------------------------------------------------
* end of forward declrations
@@ -406,6 +408,21 @@
return p;
}
+static wchar_t *x_wstrdup(const wchar_t *s)
+{
+ wchar_t *p;
+ size_t size;
+ if (s != NULL)
+ size = wcslen(s);
+ else
+ return NULL;
+ p = (wchar_t *)x_malloc((size + 2) * sizeof(wchar_t));
+ memcpy(p, s, size * sizeof(wchar_t));
+ p[size++] = L'\0';
+ p[size] = L'\0';
+ return p;
+}
+
static char *x_strndup(const char *s, size_t size)
{
char *p;
@@ -1557,7 +1574,25 @@
return rv;
}
+static char *expand_wenvars(const wchar_t *str)
+{
+ wchar_t ebuf[INFO_BUFFER_SIZE];
+ char *rv = NULL;
+ DWORD el;
+ el = ExpandEnvironmentStringsW(str, ebuf,
+ INFO_BUFFER_SIZE);
+ if (el > INFO_BUFFER_SIZE) {
+ if (xtrace)
+ warnx("expansion string to large %d", el);
+ }
+ else if (el) {
+ rv = x_strdup_utf8(ebuf);
+ }
+ return rv;
+}
+
+
/* This is the helper code to resolve late bound entry points
* missing from one or more releases of the Win32 API
*/
@@ -2182,6 +2217,41 @@
return 0;
}
+static int utf8_to_unicode(wchar_t* retstr, size_t retlen,
+ const char* srcstr)
+{
+ wchar_t *t = retstr;
+
+ /* leave an extra space for double zero */
+ --retlen;
+ /* This is correct, we don't twist the filename if it is will
+ * definately be shorter than MAX_PATH. It merits some
+ * performance testing to see if this has any effect, but there
+ * seem to be applications that get confused by the resulting
+ * Unicode \\?\ style file names, especially if they use argv[0]
+ * or call the Win32 API functions such as GetModuleName, etc.
+ * Not every application is prepared to handle such names.
+ *
+ * Note that a utf-8 name can never result in more wide chars
+ * than the original number of utf-8 narrow chars.
+ */
+ if (!MultiByteToWideChar(CP_UTF8, 0, srcstr, -1, retstr, retlen))
+ return x_cerror(0);
+ for (; *t; t++) ;
+ *t = L'\0';
+ return 0;
+}
+
+static int unicode_to_utf8(char* retstr, size_t retlen,
+ const wchar_t* srcstr)
+{
+ if (!WideCharToMultiByte(CP_UTF8, 0, srcstr, -1,
+ retstr, retlen, NULL, 0))
+ return x_cerror(0);
+
+ return 0;
+}
+
/*
* An internal function to convert an array of strings (either
* a counted or NULL terminated list, such as an argv[argc] or env[]
@@ -2257,10 +2327,441 @@
/*
* ---------------------------------------------------------------------
- * begin of WIndows GUI
+ * begin of Windows Registry
* ---------------------------------------------------------------------
*/
+#define SAFE_CLOSE_KEY(k) \
+ if ((k) != NULL && (k) != INVALID_HANDLE_VALUE) { \
+ RegCloseKey((k)); \
+ (k) = NULL; \
+ }
+
+typedef struct x_registry_t {
+ HKEY key;
+ REGSAM sam;
+ WCHAR name[256];
+} x_registry_t;
+
+static HKEY reg_rootnamed(const char *name)
+{
+ if (!strnicmp(name, "HKLM", 4))
+ return HKEY_LOCAL_MACHINE;
+ else if (!strnicmp(name, "HKCU", 4))
+ return HKEY_CURRENT_USER;
+ else if (!strnicmp(name, "HKCR", 4))
+ return HKEY_CLASSES_ROOT;
+ else if (!strnicmp(name, "HKCC", 4))
+ return HKEY_CURRENT_CONFIG;
+ else if (!strnicmp(name, "HKU", 3))
+ return HKEY_USERS;
+ else
+ return NULL;
+}
+
+static REGSAM reg_flags(const char *s)
+{
+ REGSAM sam = KEY_QUERY_VALUE;
+
+ if (strchr(s, 'a'))
+ sam |= KEY_ALL_ACCESS;
+ if (strchr(s, 'r'))
+ sam |= KEY_READ;
+ if (strchr(s, 'w'))
+ sam |= KEY_WRITE;
+ if (!(win_osver.dwMajorVersion == 5 &&
+ win_osver.dwMinorVersion == 0)) {
+ if (strstr(s, "32"))
+ sam |= KEY_WOW64_32KEY;
+ else if (strstr(s, "64"))
+ sam |= KEY_WOW64_64KEY;
+ }
+ return sam;
+}
+
+x_registry_t *reg_open(const char *name, const char *sam)
+{
+ int i;
+ HKEY r;
+ char *p;
+ x_registry_t *k;
+
+ if (!(r = reg_rootnamed(name))) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ k = x_malloc(sizeof(x_registry_t));
+ if (!(p = strchr(name, '\\'))) {
+ x_free(k);
+ errno = EINVAL;
+ return NULL;
+ }
+ if ((i = utf8_to_unicode(k->name, 255, p + 1))) {
+ x_free(k);
+ errno = i;
+ return NULL;
+ }
+ k->sam = reg_flags(sam);
+
+ if ((i = RegOpenKeyExW(r, k->name, 0, k->sam, &k->key))
+ != ERROR_SUCCESS) {
+ i = x_cerror(i);
+ x_free(k);
+ errno = i;
+ return NULL;
+ }
+
+ return k;
+}
+
+static int reg_delete(const char *name, const char *sam, int all, const char *value)
+{
+ int i = ERROR_SUCCESS;
+ HKEY r;
+ char *p;
+ x_registry_t k;
+ wchar_t v[256];
+ wchar_t *s = NULL;
+
+ if (!(r = reg_rootnamed(name))) {
+ errno = EINVAL;
+ return errno;
+ }
+
+ if (!(p = strchr(name, '\\'))) {
+ errno = EINVAL;
+ return errno;
+ }
+ if ((i = utf8_to_unicode(k.name, 255, p + 1))) {
+ errno = i;
+ return errno;
+ }
+ k.sam = reg_flags(sam);
+
+ if ((s = wcsrchr(k.name, L'\\'))) {
+ *(s++) = L'\0';
+ }
+ else {
+ errno = EINVAL;
+ return errno;
+ }
+ if ((i = RegOpenKeyExW(r, k.name, 0, k.sam, &k.key))
+ != ERROR_SUCCESS) {
+ errno = x_cerror(i);
+ return errno;
+ }
+ if (value) {
+ i = SHDeleteValueW(k.key, s, v);
+ }
+ else {
+ if (all)
+ i = SHDeleteKeyW(k.key, s);
+ else
+ i = SHDeleteEmptyKeyW(k.key, s);
+ }
+ SAFE_CLOSE_KEY(k.key);
+ return i;
+}
+
+x_registry_t *reg_create(const char *name, const char *sam)
+{
+ DWORD c;
+ int i;
+ HKEY r;
+ char *p;
+ x_registry_t *k;
+
+ if (!(r = reg_rootnamed(name))) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ k = x_malloc(sizeof(x_registry_t));
+ if (!(p = strchr(name, '\\'))) {
+ x_free(k);
+ errno = EINVAL;
+ return NULL;
+ }
+ if ((i = utf8_to_unicode(k->name, 255, p + 1))) {
+ x_free(k);
+ errno = i;
+ return NULL;
+ }
+ k->sam = reg_flags(sam);
+
+ if ((i = RegCreateKeyExW(r, k->name, 0, NULL, 0,
+ k->sam, NULL, &k->key, &c)) != ERROR_SUCCESS) {
+ i = x_cerror(i);
+ x_free(k);
+ errno = i;
+ return NULL;
+ }
+
+ return k;
+}
+
+
+static void reg_close(x_registry_t *key)
+{
+ if (key) {
+ SAFE_CLOSE_KEY(key->key);
+ x_free(key);
+ }
+}
+
+static int reg_type(x_registry_t *k, const char *name)
+{
+ int rc;
+ int rt;
+ wchar_t *wn;
+
+ if (k && IS_INVALID_HANDLE(k->key)) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (!(wn = x_wstrdup_utf8(name))) {
+ errno = EINVAL;
+ return -1;
+ }
+ if ((rc = (LONG)RegQueryValueExW(k->key, wn, NULL,
+ &rt, NULL, NULL)) != ERROR_SUCCESS) {
+ errno = rc;
+ rt = -1;
+ }
+ x_free(wn);
+ return rt;
+}
+
+static int reg_size(x_registry_t *k, const char *name)
+{
+ int rc;
+ int rt;
+ wchar_t *wn;
+
+ if (k && IS_INVALID_HANDLE(k->key)) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (!(wn = x_wstrdup_utf8(name))) {
+ errno = EINVAL;
+ return -1;
+ }
+ if ((rc = (LONG)RegQueryValueExW(k->key, wn, NULL,
+ NULL, NULL, &rt)) != ERROR_SUCCESS) {
+ rt = -1;
+ }
+ x_free(wn);
+ return rt;
+}
+
+static const char *reg_stype(int type)
+{
+ switch (type) {
+ case REG_BINARY:
+ return "REG_BINARY";
+ case REG_DWORD:
+ return "REG_DWORD";
+ case REG_EXPAND_SZ:
+ return "REG_EXPAND_SZ";
+ case REG_MULTI_SZ:
+ return "REG_MULTI_SZ";
+ case REG_QWORD:
+ return "REG_QWORD";
+ case REG_SZ:
+ return "REG_SZ";
+ case REG_DWORD_BIG_ENDIAN:
+ return "REG_DWORD_BIG_ENDIAN";
+ break;
+ }
+ return "UNKNOWN";
+}
+
+static int reg_ntype(const char *type)
+{
+ if (!stricmp(type, "REG_BINARY"))
+ return REG_BINARY;
+ else if (!stricmp(type, "REG_DWORD"))
+ return REG_DWORD;
+ else if (!stricmp(type, "REG_EXPAND_SZ"))
+ return REG_EXPAND_SZ;
+ else if (!stricmp(type, "REG_MULTI_SZ"))
+ return REG_MULTI_SZ;
+ else if (!stricmp(type, "REG_QWORD"))
+ return REG_QWORD;
+ else if (!stricmp(type, "REG_SZ"))
+ return REG_SZ;
+ else {
+ errno = EINVAL;
+ return REG_NONE;
+ }
+}
+
+
+static char *reg_value(x_registry_t *k, const char *name, int sc)
+{
+ int rc = 0;
+ DWORD rt;
+ DWORD rl, i;
+ INT64 qw;
+ wchar_t *wn;
+ char tbuf[128];
+ unsigned char *buff = NULL;
+ char *value = NULL;
+ wchar_t *wp;
+ char *cp;
+
+ if (k && IS_INVALID_HANDLE(k->key)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ if (!(wn = x_wstrdup_utf8(name))) {
+ errno = EINVAL;
+ return NULL;
+ }
+ if ((rc = (LONG)RegQueryValueExW(k->key, wn, NULL,
+ &rt, NULL, &rl)) != ERROR_SUCCESS) {
+ goto cleanup;
+ }
+ buff = x_malloc((size_t)rl);
+ if ((rc = (LONG)RegQueryValueExW(k->key, wn, NULL,
+ &rt, buff, &rl)) != ERROR_SUCCESS) {
+ goto cleanup;
+ }
+ switch (rt) {
+ case REG_SZ:
+ value = x_strdup_utf8((wchar_t *)buff);
+ break;
+ case REG_MULTI_SZ:
+ for (wp = (wchar_t *)buff; *wp; wp++) {
+ while (*wp)
+ wp++;
+ if (*(wp + 1) != L'\0')
+ *wp = sc;
+ }
+ value = x_strdup_utf8((wchar_t *)buff);
+ break;
+ case REG_EXPAND_SZ:
+ value = expand_wenvars((wchar_t *)buff);
+ break;
+ case REG_DWORD:
+ memcpy(&rt, buff, 4);
+ value = x_strdup(itoa(rt, tbuf, 10));
+ break;
+ case REG_QWORD:
+ memcpy(&qw, buff, 8);
+ value = x_strdup(_i64toa(qw, tbuf, 10));
+ break;
+ case REG_BINARY:
+ value = x_malloc(rl * 4 + 1);
+ for (i = 0, cp = value; i < (rl - 1); i++) {
+ sprintf(cp, "%02x, ", buff[i]);
+ cp += 4;
+ }
+ sprintf(cp, "%02x", buff[i]);
+ break;
+ default:
+ rc = EBADF;
+ break;
+ }
+
+cleanup:
+ x_free(wn);
+ x_free(buff);
+ errno = rc;
+ return value;
+}
+
+static int reg_set(x_registry_t *k, const char *name,
+ int type, const char *value, int sc)
+{
+ int rc = 0;
+ DWORD rt, st = type;
+ DWORD rl, i;
+ INT64 qw;
+ wchar_t *wn;
+ unsigned char *buff = NULL;
+ wchar_t *wp, *p;
+
+ if (k && IS_INVALID_HANDLE(k->key)) {
+ errno = EINVAL;
+ return errno;
+ }
+ if (!(wn = x_wstrdup_utf8(name))) {
+ errno = EINVAL;
+ return errno;
+ }
+ if ((rc = (LONG)RegQueryValueExW(k->key, wn, NULL,
+ &rt, NULL, &rl)) == ERROR_SUCCESS) {
+ if (st != REG_NONE && st != rt) {
+ rc = EINVAL;
+ goto cleanup;
+ }
+ st = rt;
+ }
+ if (st == REG_NONE)
+ st = REG_SZ;
+
+ switch (st) {
+ case REG_SZ:
+ case REG_EXPAND_SZ:
+ wp = x_wstrdup_utf8(value);
+ rc = RegSetValueExW(k->key, wn, 0, st,
+ (const unsigned char *)wp,
+ (wcslen(wp) + 1) * sizeof(wchar_t));
+ x_free(wp);
+ break;
+ case REG_MULTI_SZ:
+ wp = x_wstrdup_utf8(value);
+ rl = wcslen(wp);
+ for (p = wp; *p; p++) {
+ if (*p == sc)
+ *p = L'\0';
+ }
+ rc = RegSetValueExW(k->key, wn, 0, st,
+ (const unsigned char *)wp,
+ (rl + 2) * sizeof(wchar_t));
+ x_free(wp);
+ break;
+ case REG_DWORD:
+ i = atoi(value);
+ rc = RegSetValueExW(k->key, wn, 0, st,
+ (const unsigned char *)&i, 4);
+ break;
+ case REG_QWORD:
+ qw = _atoi64(value);
+ rc = RegSetValueExW(k->key, wn, 0, st,
+ (const unsigned char *)&qw, 8);
+ break;
+ case REG_BINARY:
+
+ break;
+ default:
+ rc = EBADF;
+ break;
+ }
+
+cleanup:
+ x_free(wn);
+ x_free(buff);
+ errno = rc;
+ return errno;
+}
+
+/*
+ * ---------------------------------------------------------------------
+ * end of Windows Registry
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * begin of Windows GUI
+ * ---------------------------------------------------------------------
+ */
+
#define MGUI_WINDOWS 32
HICON gui_h16Icon = NULL;
@@ -2740,7 +3241,7 @@
/*
* ---------------------------------------------------------------------
- * end of WIndows GUI
+ * end of Windows GUI
* ---------------------------------------------------------------------
*/
@@ -2969,6 +3470,37 @@
return retval;
}
+static int prog_reg_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... OPERATION KEY [VALUE]\n", progname);
+ fprintf(stderr, "Registry tool\n\n");
+ fprintf(stderr, " OPERATION\n");
+ fprintf(stderr, " query VALUE Query Registry Key Value\n");
+ fprintf(stderr, " add [VALUE] Add Registry Key\n");
+ fprintf(stderr, " del [VALUE] Delete Registry Key or Value\n");
+ fprintf(stderr, " type VALUE Query Registry Key Value type\n");
+ fprintf(stderr, " size VALUE Query Registry Key Value size\n");
+ fprintf(stderr, " enum VALUE Enumerate Registy Key\n");
+ fprintf(stderr, " VALUE can be 'key', 'value' or 'all'\n\n");
+ fprintf(stderr, " -a Delete all keys and subkeys.\n");
+ fprintf(stderr, " -m STRING Registry access mode.\n");
+ fprintf(stderr, " a all access\n");
+ fprintf(stderr, " r read access\n");
+ fprintf(stderr, " w wite access\n");
+ fprintf(stderr, " 32 operate on the 32-bit registry view\n");
+ fprintf(stderr, " 64 operate on the 64-bit registry view\n");
+ fprintf(stderr, " -t STRING Registry type.\n");
+ fprintf(stderr, " REG_SZ\n");
+ fprintf(stderr, " REG_EXPAND_SZ\n");
+ fprintf(stderr, " REG_MULTI_SZ\n");
+ fprintf(stderr, " REG_DWORD\n");
+ fprintf(stderr, " REG_QWORD\n");
+ fprintf(stderr, " -f CHAR Field separator for REG_MULTI_SZ.\n");
+ fprintf(stderr, " -d STRING Data to be used for add operation.\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -4243,6 +4775,200 @@
return rv;
}
+static int prog_reg(int argc, const char **argv, const char **env)
+{
+ int ch, rv = 0;
+ int delall = 0;
+ int sc = ',';
+ char *rm = NULL;
+ char *rs = NULL;
+ char *rd = NULL;
+ int rt = REG_NONE;
+ x_registry_t *reg = NULL;
+
+ while ((ch = getopt(argc, argv, "ad:f:m:r:t:hqvV", 1)) != EOF) {
+ switch (ch) {
+ case '.':
+ if (!stricmp(optarg, "verbose"))
+ xtrace = 1;
+ else if (!stricmp(optarg, "version"))
+ return print_banner(1);
+ else if (!stricmp(optarg, "help"))
+ return prog_reg_usage(0);
+ else
+ return prog_reg_usage(EINVAL);
+ break;
+ case 'a':
+ delall = 1;
+ break;
+ case 'm':
+ rm = x_strdup(optarg);
+ break;
+ case 'f':
+ sc = *optarg;
+ break;
+ case 'd':
+ rd = x_strdup(optarg);
+ break;
+ case 't':
+ rt = reg_ntype(optarg);
+ if (rt == REG_NONE) {
+ return prog_reg_usage(EINVAL);
+ }
+ break;
+ case 'v':
+ xtrace = 1;
+ break;
+ case 'V':
+ xtrace = 9;
+ break;
+ case 'q':
+ xquiet = 1;
+ break;
+ case 'h':
+ return prog_reg_usage(0);
+ break;
+ case '?':
+ case ':':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 2) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!stricmp(argv[0], "query")) {
+ if (argc < 3) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!(reg = reg_open(argv[1], rm ? rm : "r"))) {
+ rv = x_perror(0, argv[1]);
+ goto cleanup;
+ }
+ if (!(rs = reg_value(reg, argv[2], sc))) {
+ rv = x_perror(0, argv[2]);
+ goto cleanup;
+ }
+ }
+ if (!stricmp(argv[0], "add")) {
+ if (argc < 2) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!(reg = reg_create(argv[1], rm ? rm : "rw"))) {
+ rv = x_perror(0, argv[1]);
+ goto cleanup;
+ }
+ if (rd) {
+ if ((rv = reg_set(reg, argv[2], rt, rd, sc)))
+ x_perror(rv, argv[2]);
+ }
+ }
+ if (!stricmp(argv[0], "del")) {
+ const char *v = NULL;
+ if (argc < 2)
+ return prog_reg_usage(EINVAL);
+ else if (argc > 2)
+ v = argv[2];
+ rv = reg_delete(argv[1], rm ? rm : "rw",
+ delall, v);
+ }
+ if (!stricmp(argv[0], "type")) {
+ if (argc < 3) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!(reg = reg_open(argv[1], rm ? rm : "r"))) {
+ rv = x_perror(0, argv[1]);
+ goto cleanup;
+ }
+ if ((rv = reg_type(reg, argv[2])) >= 0) {
+ fputs(reg_stype(rv), stdout);
+ rv = 0;
+ }
+ }
+ if (!stricmp(argv[0], "size")) {
+ if (argc < 3) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!(reg = reg_open(argv[1], rm ? rm : "r"))) {
+ rv = x_perror(0, argv[1]);
+ goto cleanup;
+ }
+ rv = reg_size(reg, argv[2]);
+ fprintf(stdout, "%d", rv);
+ }
+ if (!stricmp(argv[0], "enum")) {
+ DWORD idx, nl;
+ int all = 0;
+ wchar_t nb[256];
+ if (argc < 3) {
+ return prog_reg_usage(EINVAL);
+ }
+ if (!(reg = reg_open(argv[1], rm ? rm : "r"))) {
+ rv = x_perror(0, argv[1]);
+ goto cleanup;
+ }
+ idx = 0;
+ if (!stricmp(argv[2], "all"))
+ all = 1;
+ if (all || !stricmp(argv[2], "key")) {
+ nl = 256;
+ while ((rv = RegEnumKeyExW(reg->key,
+ idx,
+ nb,
+ &nl,
+ NULL,
+ NULL,
+ NULL,
+ NULL)) == ERROR_SUCCESS) {
+ if (idx++)
+ fputc('\n', stdout);
+ if (all)
+ fputc('\\', stdout);
+ fprintf(stdout, "%S", nb);
+ idx++;
+ nl = 256;
+ }
+ if (rv != ERROR_NO_MORE_ITEMS)
+ goto cleanup;
+ }
+ if (all || !strnicmp(argv[2], "val", 3)) {
+ nl = 256;
+ if (idx++)
+ fputc('\n', stdout);
+ idx = 0;
+ while ((rv = RegEnumValueW(reg->key,
+ idx,
+ nb,
+ &nl,
+ NULL,
+ NULL,
+ NULL,
+ NULL)) == ERROR_SUCCESS) {
+ if (idx++)
+ fputc('\n', stdout);
+ fprintf(stdout, "%S", nb);
+ idx++;
+ nl = 256;
+ }
+ if (rv != ERROR_NO_MORE_ITEMS)
+ goto cleanup;
+ }
+ rv = 0;
+ }
+
+cleanup:
+ if (rs) {
+ fputs(rs, stdout);
+ }
+ x_free(rs);
+ x_free(rm);
+ x_free(rd);
+ reg_close(reg);
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -4265,6 +4991,7 @@
{ "image", prog_image },
{ "coff", prog_image },
{ "html", prog_html },
+ { "reg", prog_reg },
{ NULL, NULL }
};
16 years, 9 months