Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 11:22:56 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: NANY 2011 Release: UpdateVersion  (Read 8761 times)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
NANY 2011 Release: UpdateVersion
« on: November 17, 2010, 12:10:13 PM »
NANY 2011 Entry Information

Application Name UpdateVersion
Version 0.3.0
Short Description Command line tool to update some program update files by the version of the respective program.
Supported OSes Windows
Web Page this page currently
Download Link http://updateversion...om/UpdateVersion.zip
System Requirements
  • PC
Version History
  • 0.3.0 - Added -v switch for verbose output
  • 0.2.0 - Added support for InnoSetup .iss files
  • 0.1.0 - Initial release
Author phitsc

Preface
I'm afraid I'm too lacy this year to do much spare time coding. Nevertheless, I've made a tool last year which might or might not proof useful for one or the other fellow coder and which I'd like to offer for this year's NANY. Some remarks: First, it's a tool made for programmers, i.e. SW end users probably won't have much use for it. Second, it's a tool that solves a problem which probably most programmers have already solved for themselves, one way or the other. And finally, I could well imagine that some other (and better) tool already exists to solve this same problem.

So here I present UpdateVersion!


Description
UpdateVersion is a command line tool that can update some target files containing version information with the actual version information extracted from some source file. It is implemented with some flexibility and extensibility in mind.

Currently supported sources are:
  • EXEs containing a version information resource
  • FARR plugins
  • text files (via regular expressions)

Currently supported targets are:
  • PAD files
  • .dcupdate files
  • versioninfo.xml files
  • InnoSetup .iss files

The way I use the tool is in combination with a batch file:

@ECHO off
SET SevenZipPath="C:\Program Files\7-Zip\7z.exe"
SET InnoSetupPath="C:\Program Files\Inno Setup 5\ISCC.exe"

%PHI_PROJECTS%\UpdateVersion\Deploy\UpdateVersion.exe
          -s %PHI_PROJECTS%\FarrMilk\Deploy\FarrMilk.dll
          -t %PHI_PROJECTS%\FarrMilk\Deploy\FarrMilk.dcupdate
          -t %PHI_PROJECTS%\FarrMilk\Package\versioninfo.xml
          -t %PHI_PROJECTS%\FarrMilk\Package\FarrMilk.iss
%SevenZipPath% a Output\FarrMilk.zip %PHI_PROJECTS%\FarrMilk\Deploy\*.* -r -xr!.svn -tzip
%InnoSetupPath% FarrMilk.iss


Executing that batch file will first update the two files required by DCUpdater using version information extracted directly from the plugin. It will then zip everything up ready to be uploaded to the web site.

While updating these two files is not very difficult, the advantage of the tool comes when you either do it very often (saves time), or when you do it very rarely (and have forgotten what you actually have to change).

Features
Description says it all really.

Planned Features
I'm open for suggestions.

Screenshots
Will come but will be very boring!

Usage
Installation
No installation required, just copy the .EXE and .XML to some directory.

Using the Application
See Closing remarks.

Uninstallation
Delete the directory where the .EXE and .XML file are.

Known Issues
None that I know of.

Closing remarks
I understand that this tool is of very limited value to most of the donationcoder community. Nevertheless, I'll make the following pledge:

If a single person states here that he might maybe have use for the tool, I'll actually add some documentation to it :) And of course I'm also open for feature requests if anyone should have some similar requirements.
« Last Edit: January 12, 2011, 02:21:26 PM by phitsc »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,014
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #1 on: November 17, 2010, 12:23:01 PM »
Cool, I think I have use for this.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #2 on: November 17, 2010, 12:55:30 PM »
Cool, I think I have use for this.
I was afraid you were going to say this ;)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #3 on: November 18, 2010, 03:50:10 AM »
Here's some more detail about the tool. Currently, it can update the following fields:

  • Name
  • Version
  • ReleaseDate
  • FileSize
  • ReleaseStatus
  • WebSite
  • ShortDescription
  • LongDescription

Some of that information is taken from the source file's contents or resource, others from the source file's attributes (e.g. ReleaseDate or FileSize).

What is taken from where gets obvious by looking at the tools XML configuration file. Some more info to follow...

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #4 on: November 25, 2010, 04:25:22 PM »
I've started to create an installer for the FarrMilk plugin (and will do so for the other plugins as well). I'm using Inno Setup for that. So UpdateVersion can now also update the AppVersion field in .iss files.

Still no documentation though.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #5 on: December 02, 2010, 02:41:36 PM »
Hm, though this is useful, you do know that Inno Setup with the ISPP preprocessor (comes standard with the Quick Setup Pack) does have fabulous support for pre-compile scripting/processing, amongst which is version extraction from exe/dll version resources, and even from textfiles when pressed? I'd not pursue in this direction further as it's 'already there'...
Examples and much more is available from the news groups at the jrsoftware.org site.

Inno Setup is ofcourse the best choice you can make for a free installer tool :Thmbsup:

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #6 on: December 02, 2010, 02:51:12 PM »
Thanks Ath. No, I didn't know. Well, it's not really a question of pursuing any further as what I need is already implemented in UpdateVersion. In fact, I've implemented UpdateVersion before I even thought about using Inno Setup to make an installer. I would also guess that there's no Inno Setup script yet that can update files required by DCUpdater? So I would have had to implement them anyway. But you might be right in that it would haven been better to do that with ISPP instead of C++ ;)
« Last Edit: December 02, 2010, 02:53:24 PM by phitsc »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #7 on: December 02, 2010, 03:50:58 PM »
ISPP can handle quite some stuff, but as I said, you have to press it a little (meaning it's not really easy)
It can update external files, but afaics, it doesn't handle s&r based on regex's, but a simple s&r it should be capable of. And looking at the help, it seems it can only write in ini format files...
And then there's the occasional Exec(), ofcourse, so some external tool can come in handy ;)

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 567
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #8 on: January 10, 2011, 02:12:45 PM »
This looks like an awesome tool, and I wish I looked into it before the screencasts came out. :-[

However, as much as there is the ability for me to test and prod around with test files, I'd love to have a bit more verbose output possible, so I can see exactly what lines / tags it adjusts. As it is now, I've got a preprelease.bat sitting in the directories of my tools, and that one prepares the appropriate packages for my files (copying files from build/editing locations), which then does the zipping up and/or ISS compilation.

So, stuff I'd love to see added:
  • A verbose switch to see what lines it adjusts in what files.
  • An ability not to update the FileSize in the pad_file, as it differs considerably for my JottiQ releases and I use a hardcoded size of the installer instead. (It seems the most appropriate size.)
  • Same with long and short descriptions, as I don't believe those files match my executable very well (if I even use them - I don't remember.)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,014
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #9 on: January 10, 2011, 02:22:13 PM »
Quote
An ability not to update the FileSize in the pad_file

i dont pay the slightest attention to filesize in my pad files -- i just make up numbers.  it's too hard to keep updated and no one seems to care.

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 567
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #10 on: January 10, 2011, 02:35:52 PM »
I don't care much either, but the way I see it the information should either be correct or too large. The size of my executable will always be too small to use, so I want to hardcode it. :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #11 on: January 10, 2011, 02:53:55 PM »
@mouser: Damn, you made a screen-cast of UpdateVersion. How cool is that  :-*. Thanks!

@worstje:
- Concerning verbose output, I'll see how easy that would be to implement.
- Getting rid of FileSize, ShortDescription and LongDescription should be easy: just open your local copy of UpdateVersion.xml and delete the <FileSize>, <ShortDescription> and <LongDescription> elements in the <Type>xml,rootnode,XML_DIZ_INFO</Type> target.

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 567
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #12 on: January 10, 2011, 03:09:25 PM »
Ahh. Shame on me for only watching the screencast - I hadn't even seen there was an entire .xml file with configuration settings and such. Shame on me indeed. :(

It's just nice having the output visible - I always have to go over my preprelease.bat to see if it went allright (Idiotic me tends to test from there at occasion, and then stupid explorer/opera/whatever end up using DLLs which can't be replaced.. afin, you get the idea). The more I can see about stuff being successful, the less worries I'll have and the less problems that suddenly sprout up when users download the final product. :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,014
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #13 on: January 10, 2011, 03:14:43 PM »
Agree that it would be nice to report on commandline the values inserted.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,117
    • View Profile
    • Donate to Member
Re: NANY 2011 Release: UpdateVersion
« Reply #14 on: January 12, 2011, 02:24:59 PM »
Added a switch (-v) for verbose output.