Author: mladen.turk(a)jboss.com
Date: 2008-04-08 09:05:58 -0400 (Tue, 08 Apr 2008)
New Revision: 1538
Modified:
trunk/build/install/installer/installers/jbossas/_install/install.bat
trunk/build/install/xtool/xtool.c
Log:
Add xcopy tool
Modified: trunk/build/install/installer/installers/jbossas/_install/install.bat
===================================================================
--- trunk/build/install/installer/installers/jbossas/_install/install.bat 2008-04-08
12:40:48 UTC (rev 1537)
+++ trunk/build/install/installer/installers/jbossas/_install/install.bat 2008-04-08
13:05:58 UTC (rev 1538)
@@ -112,12 +112,11 @@
REM Do an actual installation in INSTALL_DEST/PACKAGE_NAME by copying the files from
REM INSTALL_BASE/PACKAGE_NAME
-xcopy /Q /Y /E /I /C "%INSTALL_BASE%%PACKAGE_NAME%"
"%INSTALL_DEST%\%PACKAGE_NAME%" > .result
-set /P XTOOLRC= < .result
-del /Q /F .result
+xtool xcopy -q "Installing %INSTALL_NAME%"
"%INSTALL_BASE%%PACKAGE_NAME%" "%INSTALL_DEST%\%PACKAGE_NAME%"
+if %errorlevel% == 0 (
+ xtool msg -qt MB_OK -i ? "Istallation finished" "%INSTALL_DESC%
installed in##%INSTALL_DEST%\%PACKAGE_NAME%"
+)
-xtool msg -qt MB_OK -i ? "Istallation finished" "%INSTALL_DESC% installed
in##%INSTALL_DEST%\%PACKAGE_NAME%##%XTOOLRC%"
-
:cmdEnd
echo Finished %INSTALL_PROG% %DATE% %TIME%
exit %RETVAL%
Modified: trunk/build/install/xtool/xtool.c
===================================================================
--- trunk/build/install/xtool/xtool.c 2008-04-08 12:40:48 UTC (rev 1537)
+++ trunk/build/install/xtool/xtool.c 2008-04-08 13:05:58 UTC (rev 1538)
@@ -3595,6 +3595,14 @@
return retval;
}
+static int prog_xcopy_usage(int retval)
+{
+ fprintf(stderr, "Usage: %s [OPTION]... TITLE SOURCE DESTINATION\n",
progname);
+ fprintf(stderr, "Copies files from SOURCE to DESTINATION\n\n");
+ print_stdusage();
+ return retval;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs usage
@@ -5485,6 +5493,75 @@
return rv;
}
+static int prog_xcopy(int argc, const char **argv, const char **env)
+{
+ int ch, rv = 0;
+ wchar_t *p, *msg = NULL;
+ SHFILEOPSTRUCTW shOp;
+
+ if (!GuiInitialize()) {
+ return x_perror(0, "Windows GUI");
+ }
+ while ((ch = getopt(argc, argv, "hqvV", 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_xcopy_usage(0);
+ else
+ return prog_xcopy_usage(EINVAL);
+ break;
+ case 'v':
+ xtrace = 1;
+ break;
+ case 'V':
+ xtrace = 9;
+ break;
+ case 'q':
+ xquiet = 1;
+ break;
+ case 'h':
+ return prog_xcopy_usage(0);
+ break;
+ case '?':
+ case ':':
+ return EINVAL;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc < 3) {
+ return prog_xcopy_usage(EINVAL);
+ }
+ msg = x_wstrdup_utf8(argv[0]);
+ for (p = msg; *p; p++) {
+ if (*p == L'#' && *(p + 1) == L'#') {
+ *(p++) = L'\r';
+ *(p++) = L'\n';
+ }
+ }
+
+ shOp.hwnd = HWND_DESKTOP;
+ shOp.wFunc = FO_COPY;
+ shOp.fFlags = FOF_NOCONFIRMATION |
+ FOF_NOCONFIRMMKDIR |
+ FOF_SIMPLEPROGRESS;
+
+ shOp.pFrom = x_wstrdup_utf8(argv[1]);
+ shOp.pTo = x_wstrdup_utf8(argv[2]);
+ shOp.lpszProgressTitle = msg;
+
+ rv = SHFileOperationW(&shOp);
+ x_free(msg);
+ x_free((wchar_t *)shOp.pFrom);
+ x_free((wchar_t *)shOp.pTo);
+ return rv;
+}
+
/*
* ---------------------------------------------------------------------
* end of programs
@@ -5511,6 +5588,7 @@
{ "msg", prog_msg },
{ "jdk", prog_jdk },
{ "dir", prog_browse },
+ { "xcopy", prog_xcopy },
{ NULL, NULL }
};
Show replies by date