Version control with simple text files - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

James Newton
Posts: 2
Joined: Tue Nov 14, 2006 10:29 pm

Version control with simple text files

In my application, there are a few small files that are simple text documents that change the way the program works. Most of the updates (or I hope patches if I can ever get that to work) will be to these files.

The problem is, AI doesn't seem to have a way to know which version has been installed from looking at these files other than by file size. For example, it doesn't have an option to check for a created date after some release date.

Checking the file size causes trouble as shown in the following example: If version 1 has file A with a size of 100B, then version 2 patches that same file to 200B, all is well up to that point. I can configure the update file to say that version 2 is installed if file A is 200B, so when only version 1 is in, version 2 will show up as an applicable patch. But, if version 3 updates the file to 300B, then after it is installed, version 2 shows up again since the file is not, of course, now 200B.

I could compensate for this by always removing the file size check from the prior update version so after version 3 is released, version 2 is no longer checked for. But with patches, there may be two files; A and B and if version 2 updates A and version 3 updates B, we want both to be listed. After many patches with many files, my concern is that I will miss removing the file size from some prior update and end up with customers downgrading rather than upgrading.

If there was a way to check for a file size of X OR MORE, then the above example would work until some future version revises the file to a smaller size. It would seem to me that the updater should be able to check for patches based on the creation date of the file. If it was created AFTER the update was made available, then it is very probable that the update is not needed.

So, instead, I am going to add the over all product version number into a registry setting and then base the installation of updates and patches on that. My only concern is that if someone messes with or deletes the little text file, the updater is not going to check to see if they are the correct size. Probably not a problem.

Before I make that change, I just wanted to ask if anyone else had run into this and if there were other ideas for managing it.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

There are two options that you can use to detect if an update is already installed or not. Those options are:

1. "FilePath" (check the existence of a file) that can be combined with "FileSize" (check the size of the file specified in the "FilePath") or Version (check the version of the specified file, only for versioned files).
2. "RegistryValue" (keeps the version of the update in a registry value).

In your case my suggestion is to use "RegistryValue" with "Version". You need to add this registry value in the "Registry" page and increase its value with each upgrade or patch.

Also you can read more here:
http://www.advancedinstaller.com/user-g ... rties.html

Hope this helps.

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”