Author: wyoung
Date: Wed Jul 23 04:42:21 2008
New Revision: 2318
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2318&view=rev
Log:
Replaced install.bat with install.hta.
Added:
trunk/install.hta
Removed:
trunk/install.bat
Modified:
trunk/README-Visual-C++.txt
trunk/Wishlist
Modified: trunk/README-Visual-C++.txt
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/README-Visual-C%2B%2B.txt?rev=2318&r1=2317&r2=2318&view=diff
==============================================================================
--- trunk/README-Visual-C++.txt (original)
+++ trunk/README-Visual-C++.txt Wed Jul 23 04:42:21 2008
@@ -72,8 +72,17 @@
examples\vstudio. See README-examples.txt for further details.
Once you're sure the library is working correctly, you can run
- the install.bat file at the project root to automatically install
- the library files and headers in subdirectories under c:\mysql++.
+ the install.hta file at the project root to install the library
+ files and headers in a directory of your choosing.
+
+ (Aside: You may not have come across the .hta extension before.
+ It's for a rarely-used feature of Microsoft's Internet Explorer,
+ called HTML Applications. Know what Adobe AIR is? Kinda like
+ that, only without the compilation into a single binary blob,
+ the cross-platform compatibility, and the power of Flash and
+ ActionScript 3. These limitations don't cause a problem here.
+ In fact, AIR would be vast overkill here. Just open install.hta
+ in a text editor to see how it works.)
Using MySQL++ in an MFC Project
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=2318&r1=2317&r2=2318&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Wed Jul 23 04:42:21 2008
@@ -16,16 +16,6 @@
o Any time you must hand-roll some SQL code in your program,
consider whether it could be generalized to a widely-useful
API feature.
-
-
-Known Bugs to Fix
------------------
- o install.bat doesn't cope with new vs2003 and vs2005
- subdirectories correctly. Instead of fixing the batch file,
- replace it with a JScript for WSH, so we can have actual logic
- in the script, which will detect what's built before it goes
- and tries to install it. It might even pop up a simple GUI to
- ask for the user's installation preferences.
v3.1 Tentative Plan
Removed: trunk/install.bat
URL: http://svn.gna.org/viewcvs/mysqlpp/trunk/install.bat?rev=2317&view=auto
==============================================================================
--- trunk/install.bat (original)
+++ trunk/install.bat (removed)
@@ -1,38 +1,0 @@
[EMAIL PROTECTED] off
-if "%1" == "" goto error
-
-set BASE_DIR=c:\mysql++
-set INST_INC_DIR=%BASE_DIR%\include
-set INST_LIB_DIR=%BASE_DIR%\%1
-
-if not exist %BASE_DIR% mkdir %BASE_DIR%
-if not exist %INST_INC_DIR% mkdir %INST_INC_DIR%
-if not exist %INST_LIB_DIR% mkdir %INST_LIB_DIR%
-if not exist %INST_LIB_DIR%\debug mkdir %INST_LIB_DIR%\debug
-if not exist %INST_LIB_DIR%\release mkdir %INST_LIB_DIR%\release
-
-copy lib\*.h "%INST_INC_DIR%" > NUL
-
-if exist *.a goto install_mingw
-copy debug\*.dll "%INST_LIB_DIR%\debug" > NUL
-copy debug\*.lib "%INST_LIB_DIR%\debug" > NUL
-copy release\*.dll "%INST_LIB_DIR%\release" > NUL
-copy release\*.lib "%INST_LIB_DIR%\release" > NUL
-goto install_done
-:install_mingw
-copy *.a "%INST_LIB_DIR%\debug" > NUL
-echo WARNING: I assume you built a debug version of the library, as that
-echo is what you get with MinGW unless you make a special effort. You
-echo must do a manual install if you make a release version.
-
-:install_done
-echo MySQL++ (%1 version) installed successfully!
-goto end
-
-:error
-echo usage: install [subdir]
-echo.
-echo Installs MySQL++ into the given subdirectory of %BASE_DIR%
-
-:end
-
Added: trunk/install.hta
URL: http://svn.gna.org/viewcvs/mysqlpp/trunk/install.hta?rev=2318&view=auto
==============================================================================
--- trunk/install.hta (added)
+++ trunk/install.hta Wed Jul 23 04:42:21 2008
@@ -1,0 +1,299 @@
+<!----------------------------------------------------------------------
+ install.hta - GUI installer for Windows systems, using Microsoft's
+ HTML Application technology. Requires MSIE, probably v5+.
Might
+ run on IE4.
+
+ For all other platforms, use "make install".
+
+ Copyright (c) 2008 by Educational Technology Resources, Inc.
+ Others may also hold copyrights on code in this file. See the
+ CREDITS file in the top directory of the distribution for details.
+
+ This file is part of MySQL++.
+
+ MySQL++ 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.1 of the License, or
+ (at your option) any later version.
+
+ MySQL++ 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 MySQL++; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+---------------------------------------------------------------------->
+
+<html>
+ <head>
+ <title>Install MySQL++ Development Files</title>
+
+ <hta:application
+ applicationname="mysqlppInstaller"
+ borderstyle="raised"
+ innerborder="no"
+ scroll="no"
+ singleinstance="yes"
+ sysmenu="no"/>
+
+ <style>
+ body {
+ background-color: buttonface;
+ margin: 10px;
+ }
+
+ body, button, input, select, td {
+ font-family: Trebuchet MS, Helvetica;
+ font-size: 10pt;
+ }
+
+ input.status {
+ background-color: buttonface;
+ border: none;
+ }
+ </style>
+
+ <script language="javascript" type="text/javascript">
+ function $(id) { return document.getElementById(id); }
+ </script>
+
+ <script language="javascript" type="text/javascript">
+ var fso = new
ActiveXObject('Scripting.FileSystemObject');
+ var directoryList, driveList, instDirField,
versionedDirectoryBox;
+ var instBase = 'MySQL++';
+
+ // Copies a file under a given prefix directory to
another directory
+ // given as a subdirectory under some fixed prefix
directory,
+ // creating the whole directory path if needed, if it
doesn't exist.
+ // Skips prefix prepending if prefix is null. Skips
directory
+ // creation if source file doesn't exist.
+ function copyFile(filePrefix, file, dirPrefix, subdir)
+ {
+ var src = filePrefix ?
fso.BuildPath(filePrefix, file) : file;
+ if ((!filePrefix ||
fso.FolderExists(filePrefix)) &&
+ ((src.indexOf('*') != -1) ||
fso.FileExists(src))) {
+ var dst = createFolderRecursive(
+ dirPrefix ?
fso.BuildPath(dirPrefix, subdir) : subdir);
+ try {
+ fso.CopyFile(src, dst);
+ }
+ catch (e) {
+ alert('Failed to copy ' + file
+ ' to ' + target + ': ' +
+ e.message +
'\n\nInstallation aborted!');
+ window.close();
+ }
+ }
+ }
+
+ // Creates a folder if it doesn't already exist. If
creation
+ // attempt fails, puts up alert dialog explaining the
problem and
+ // quits program.
+ function createFolder(d)
+ {
+ if (!fso.FolderExists(d)) {
+ try {
+ fso.CreateFolder(d);
+ }
+ catch (e) {
+ alert('Failed to create ' + d +
' folder: ' +
+ e.message +
'\n\nInstallation aborted!');
+ window.close();
+ }
+ }
+ }
+
+ // Like createDirectory(), but will create parent
directories as
+ // needed. Returns d, normalized.
+ function createFolderRecursive(d)
+ {
+ var i, dir = '', dirElements = d.split('\\');
+ for (i = 0; i < dirElements.length; ++i) {
+ dir += dirElements[i] + '\\';
+ createFolder(dir);
+ }
+ return dir;
+ }
+
+ // Called when app is fully loaded, so initialize
ourselves.
+ function init()
+ {
+ // Set initial window size
+ window.resizeTo(440, 324);
+
+ // Get references to main UI elements
+ directoryList = $('directory');
+ driveList = $('drive');
+ instDirField = $('instDir');
+ versionedDirectoryBox = $('versionedDirectory');
+
+ // Populate drop-down list of available drives
+ populateDriveList();
+
+ // Populate list of directories on the current
drive
+ populateDirectoryList();
+
+ // Now that we have drive and directory lists,
set initial value
+ // for installation directory from default list
selections.
+ updateInstDir();
+
+ // Set up UI event handlers. We put it off to
this point so
+ // UI is populated before first handler gets
called.
+ driveList.onchange = function() {
+ populateDirectoryList();
+ updateInstDir();
+ }
+ directoryList.onchange =
versionedDirectoryBox.onclick =
+ updateInstDir;
+ }
+
+ // Do the actual installation
+ function install()
+ {
+ // Get installation target directory name
+ var target = instDirField.value;
+
+ // Install header files
+ copyFile('lib', '*.h', target, 'include');
+
+ // Install MinGW library build, if it exists
+ copyFile(null, 'libmysqlpp.a', target,
'mingw\\lib');
+ copyFile(null, 'mysqlpp.dll', target,
'mingw\\lib');
+
+ // Install any and all existing VC++ library
builds
+ var i, j, vcDir,
+ versions = [ '3', '5', '8' ],
+ subdirs = [ 'Debug', 'Release'
];
+ for (i = 0; i < versions.length; ++i) {
+ vcDir = fso.BuildPath('vc200' +
versions[i], 'Debug');
+ copyFile(vcDir, 'mysqlpp_d.dll',
target, vcDir);
+ copyFile(vcDir, 'mysqlpp_d.lib',
target, vcDir);
+ vcDir = fso.BuildPath('vc200' +
versions[i], 'Release');
+ copyFile(vcDir, 'mysqlpp.dll', target,
vcDir);
+ copyFile(vcDir, 'mysqlpp.lib', target,
vcDir);
+ }
+
+ window.close();
+ }
+
+ // Populates a drop-down list with the set of fixed
disks and
+ // removable drives with media in them.
+ function populateDriveList()
+ {
+ var defLetter = 'C';
+ var e, i, letter, name;
+
+ for (e = new Enumerator(fso.Drives);
!e.atEnd(); e.moveNext()) {
+ i = e.item();
+ if (i.IsReady) {
+ letter = i.DriveLetter;
+ name = letter + ': - ';
+
+ if ((i.DriveType == 3) &&
+
i.ShareName.length) {
+ name += i.ShareName;
+ }
+ else if ((i.DriveType != 3) &&
+
i.VolumeName.length) {
+ name += i.VolumeName;
+ }
+ else {
+ name += '(no name)';
+ }
+
+ driveList.add(new Option(name,
letter,
+ letter ==
defLetter, letter == defLetter));
+ }
+ }
+ }
+
+ // Populates a list box with the top-level directories
on the
+ // currently-selected disk drive.
+ function populateDirectoryList()
+ {
+ var driveRoot =
+
driveList.options[driveList.selectedIndex].value + ':\\';
+ var e, f = fso.GetFolder(driveRoot);
+ if (f) {
+ directoryList.options.length = 0;
+ directoryList.add(new Option(driveRoot,
driveRoot, true, true));
+ for (e = new Enumerator(f.SubFolders);
!e.atEnd(); e.moveNext()) {
+ directoryList.add(new
Option(e.item() + '\\'));
+ }
+ }
+ else {
+ alert('Failed to get directory list for
' + driveRoot);
+ }
+ }
+
+ // On clicking the text label associated with
"versioned install
+ // directory" checkbox, toggle checkbox and update UI.
+ function toggleVersioning()
+ {
+ if (versionedDirectoryBox) {
+ versionedDirectoryBox.checked =
!versionedDirectoryBox.checked;
+ updateInstDir();
+ }
+ }
+
+ // Called any time something changes that affects how
we calculate
+ // the installation directory name. Rebuilds it.
+ function updateInstDir()
+ {
+ instDirField.value =
+
directoryList.options[directoryList.selectedIndex].text +
+ instBase +
+ (versionedDirectoryBox.checked
? '\\3.0.4' : '');
+ }
+ </script>
+ </head>
+
+ <body onload="init()">
+ Where would you like to install the MySQL++ development files?
+
+ <table cellspacing=10 cellpadding=0 border=0 width=100%>
+ <tr>
+ <td align=right valign=center>Directory:</td>
+ <td valign=center width=99%>
+ <input type="text" readonly
class="status" id="instDir"
+ size=50>
+ </td>
+ </tr>
+
+ <tr>
+ <td align=right valign=center>Drives:</td>
+ <td width=99%>
+ <select id="drive">
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td align=right valign=top>Directories:</td>
+ <td width=99%>
+ <select id="directory" size="6">
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td> </td>
+ <td>
+ <input type="checkbox"
id="versionedDirectory">
+ <span style="cursor: default"
onclick="toggleVersioning()">Install
+ in versioned
directory?</span>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan=2 align=center>
+ <button onclick="install()"> Install
Now </button>
+
+ <button onclick="window.close()"> Never
Mind </button>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits