Archive for February, 2011

hcOPF - Installing with the Package Generator

Sunday, February 27th, 2011

I just updated the hcOPF package generator.  This project is a utility I started work on in order to simplify the maintenance of hcOPF packages.  It’s far to time consuming to update the packages for all Delphi compilers supported every time I make a change to the one I’m working on.  If they get out of sync, it becomes a nightmare for someone unfamiliar with the framework to resolve.  I looked at the Jedi package generator, but it’s a complex beast with support for C++ Builder, which I don’t need.

I also considered building an installer based on the MustangPeak component installer, but that’s on hold for the moment as I simply don’t have enough hours in the day.

My KISS solution was to chop up the DPK into three files suffixed  by what they contain (contains, requires, and directives).  The PackageGenerator application uses only native delphi controls so you should be able to compile it with any Delphi version you want.

The UI is pretty simple.

The hcOPF Package Generator

The hcOPF Package Generator

You select one or more compilers for which you want to generate current packages.  You must set the root compiler folder path so the application can find the subdir for each compiler version supported in which to save the generated files.  The default is “Z:\hcOPF\Compilers”.  I recommend using a short path and creating an environment variable in Delphi to point to the folder off of the root of the drive.  My environment variables are as follows:

hcOPF = $(HD)\hcOPF
HD = Z:

This way, I can change the drive mapping, or the root folder of the hcOPF framework and I don’t have to change any of my Library Paths  (the hcOPF packages also use the $(hcOPF) environment variable so defining $(hcOPF) is mandatory):

$(hcOPF)\Compilers\D7
$(hcOPF)\Lib\D7
$(hcOPF)\3rdParty\TPerlRegEx
$(hcOPF)\Source\Include
$(hcOPF)\Source\Resources

The following paths should be added to your Browsing Path:

$(hcOPF)\Source\Core
$(hcOPF)\Source\Common
$(hcOPF)\Source\DAL
$(hcOPF)\Source\GUI
$(hcOPF)\Source\Validators
$(hcOPF)\Source\Utils
$(hcOPF)\Source\Reporting

This means trying hcOPF should be as simple as:

1) Configure your delphi environment as described above.  That means creating an hcOPF environment variable, and populating the Library and Browing Paths as described.

2) Get the source from SVN.  Here are some instructions on how to use the SVN client to get the source.

3) Run the PackageGenerator - an EXE is in the Bin folder even though everyone should be able to compile the source.

4) Install the TPerlRegEx component.  The hcOPFValidators package requires this component for RegEx validation.  I have defined an interface so it’s possible to use your own RegEx evaluator if you wish.

5) Select the compiler you want to generate current packages for, and click the Generate button.

6) Open the AllPackages.bpg file in the target compiler directory for the compiler you selected.  For instance, if you checked D11 (Delphi 2007) then open the AllPackages.bpg file in \trunk\Compilers\D11.  In this case, Delphi uses MSBuild so it will upgrade the packages, creating the necessary XML files.  That is why the Clean Target Directories option is checked by default.

7) Select the first package in the group (HengenOPFCore.dpk) and Rt. Click - select Build All from Here

8) Rt. Click on each package from top to bottom that starts with ‘dcl’ and select Install

You should now have hcOPF installed and be able to compile the Demos (use the Delphi 7 projects as I have not yet updated the projects for other compilers.  I might actually adapt the PackageGenerator code to do that for me).

I have tested the output of the package generator with Delphi 2007 since I recently migrated my current project so I can compile under either Delphi 7 (yes I still use it as my primary IDE), and Delphi 2007.  If you have any issues, comments, or suggestions, let me know.

I did recently discover that versions of Delphi that use MSBuild do not preserve the DCU Output folder when upgrading the project.  Be sure to change the folder to ‘..\..\Lib\D??’ where  ?? represents the Delphi version.  I may change the package generator to generate DPROJ files.

Is an SSD in your Future?

Wednesday, February 9th, 2011

I run Delphi in a Virtual Machine on my 2.5 Ghz MacBook Pro 4.1 with 4Gb RAM.  It’s great to have a portable platform, and the combination of Mac OS/X and VMWare Fusion 3 has worked well for me.  However it’s not without it’s limitations.  There are certainly times I wished I had more RAM (ever tried to run more than 1 VM?), and of course I always want more speed.

To squeeze better performance from VMWare Fusion on my MacBook Pro I bought a SATA II express card off of eBay for under $20 and then attached an external 3.5″ hard drive in a SATA enclosure.  It’s significantly faster than running a VM off the Mac’s internal hard drive in part because mine is only a 5400 rpm drive on a SATA I internal interface.  This was great for a while, but meant I had to pack around a lot of equipment including a power adapter for my external drive.  Forget one piece, and you’re SOL when you get on site.

I have been considering my options for squeezing more performance from my laptop, including going to a PC laptop, or loading Windows natively on my Mac, or spending the big bucks and upgrading my Mac.  I had even contemplated replacing my internal HD with an SSD.  They’re just too expensive to replace an internal 320 Gb drive with anything close to the same capacity, and because my Mac’s internal SATA is only a 1.5 Gb interface it wouldn’t make any sense to do so.

The other day I got an email sale advertisement from MemoryExpress.  I checked out the pricing on their SSDs, and concluded a 256Gb drive was still way too expensive.  There was a smaller OCZ Vertex 50Gb SSD on sale though for a mere $80 after rebate.  I thought I would check it out, and when I inquired at the store I discovered for $20 I could get an enclosure that would use USB power to run the drive and I could connect the drive through either the SATA interface or USB.  I was sold!

Although I haven’t run any benchmarking software, I can tell you that this combination is noticeably faster than my external 7200 rpm hard drive, and it’s much more compact and more reliable = better for portability.  Highly recommended!