Ramblings

Delphi Programming Observations

Source Code License About Contact

Friday, May 6, 2011

Compiling SetVersion.exe with a Delphi before Delphi 2009

Compiling SetVersion.exe

Several people have emailed me to get a compiled version of SetVersion.exe, or with problems when they try to compile with a version of Delphi before 2009.

The developer of the DelphiPackageTool has a compiled version available at http://delphipackageto.svn.sourceforge.net/viewvc/delphipackageto/bin/SetVersion.exe?view=log, you should be able to click the download link on that page.

If you would like to compile it yourself, you should be able to follow these steps:

Clone the git repo

git clone https://github.com/jasonpenny/democode

Now you should be able to open the SetVersion.dpr at democode/SetVersion/

Get the older version of Colin Wilson’s resource code, go to http://www.wilsonc.demon.co.uk/ ,
for Delphi 2006 and Delphi 2007: click on Delphi 2006, then download these files

Take files from those zip files and replace the same named files at democode/Others/ColinWilson/

  • ImageTypes100
    • unitEXIcon.pas
  • ResourceUtils100
    • unitPEFile.pas
    • unitResFile.pas
    • unitResourceDetails.pas
    • unitResourceExaminer.pas
    • unitResourceGraphics.pas
    • unitResourceToolbar.pas
    • unitResourceVersionInfo.pas

unitResourceGraphics.pas references gifimage, so copy GIFImage.pas from ImageTypes100 to the democode/Others/ColinWilson/ directory and add it to the Delphi project.

Then it should be able to compile.

Note

The latest email I received asked how to compile in order to modify the product version of the file rather than the file version.

Note that there file version and product version are stored as both numbers and strings in the resource. SetVersion.exe currently modifies only the file version stored as numbers. The “File version” of an EXE when viewed from the Windows Explorer shows this, but it shows the string representation for “Product version”. In order to change the string version, you need to use

VersionInfoResourceDetails.SetKeyValue('ProductVersion', '1234567');
posted by Jason at 11:36 pm  

Wednesday, March 16, 2011

Delphi, Git and the future

I’m getting more and more hits to this blog for searches including the words “git” and “delphi”, as well as seeing more Delphi people mention git and use GitHub on twitter and stack overflow.

I’m still happy with using the MSysGit bash console to work with git, but it seems more people are finding Git Extensions to provide a good experience right in the Windows shell.

There is a project called libgit2 that was started a while ago, and was renewed during last year’s (2010) Google Summer of Code, and put on GitHub/libgit2. It is a library for dealing with git repositories, and can be linked to other code without requiring the other code to also be GPL, which I think is a big plus. It can be compiled into a DLL with Microsoft Visual C++ Express (available from MS at no cost). The project has had a lot of activity lately, with bindings for several languages.

I started a project called GitForDelphi to create bindings for Delphi. It currently exposes all the functions exported from libgit2, and I translated some of the unit tests from the libgit2 project. I tried to get all the tests that confirm the functionality rather than internal details, and all the tests that I translated to Delphi are currently passing.

As I said, the libgit2 project is very active, and so far I’ve only been tracking the exported C API. I don’t think this is ideal for Delphi users, especially when you come across things like structures with pointers to pointers. These are easy to deal with in C with array indexing, but it gets a little hairy in Delphi. I intend to hide a lot of the C API in a wrapper class, but I haven’t figured out just how I want it to look yet; I’ll probably name it TGitRepository.

If you’d like to contribute, I’m on twitter as @jasonpenny, or fork the repo on GitHub.
(more…)

posted by Jason at 8:39 pm  

Tuesday, March 23, 2010

Custom Protocol Handler in Delphi

I have wanted to look into creating a custom protocol handler to plug into a TWebBrowser with Delphi for a while, called an Asynchronous Pluggable Protocol. I have seen a few implementations, but they were all quite old, and none did exactly what I wanted, which is to be able to create a temporary APP, which is local to the application and self contained.


(more…)

posted by Jason at 7:11 pm  

Powered by WordPress