View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
checkVersion - Check for a newer file version on the File Exchange

5.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 4.78 KB File ID: #39993 Version: 1.1
image thumbnail

checkVersion - Check for a newer file version on the File Exchange


Yair Altman (view profile)


24 Jan 2013 (Updated )

checkVersion implements an auto-update mechanism to check for a newer version of a utility on FEX

| Watch this File

File Information

     [status, message] = checkVersion(filename, fexId, mode)
checkVersion implements an auto-update background mechanism to check for a newer version of a file on the Matlab File Exchange (FEX). This enables FEX authors to easily embed a non-intrusive update mechanism in their utilities, enabling its users to automatically update whenever a new version is uploaded to FEX.
checkVersion(filename,fexId) checks on FILENAME's File Exchange webpage whether any newer version of this utility has been uploaded. If so, a popup notice is presented with the date and description of the latest version. The popup enables users to download the newer version into the current folder, or skip. There is also an option to skip the update and not to remind ever again.
checkVersion is typically used after an applications has completed its main task or has presented its GUI, in order to silently check for an available update with minimal impact on the user. This could also be done by using a background single-shot timer (see example below).
checkVersion(...,'silent') runs checkVersion in silent mode, without prompting the user in case a newer version is detected. Newer file versions will automatically be downloaded and installed.
[status, message] = checkVersion(...) returns a string with the update check's status (ignored / unknown / up-to-date / available / downloaded / error), along with a descriptive message.
     status = checkVersion('uiinspect',17935);
     [status, latestUploadDate] = checkVersion('uiinspect',17935);
     [status, errorMessage] = checkVersion('noSuchFile',1234);
     % run checkVersion in a background single-shot timer
     start(timer('TimerFcn',@(h,e)checkVersion('uiinspect',17935), 'StartDelay',5));
Known issues/limitations:
This utility will silently fail if and when MathWorks will ever modify the File Exchange webpage format. In such case, download the latest version of the utility, which hopefully solves the problem, or send me an email.
Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)


Findjobj Find Java Handles Of Matlab Graphic Objects and Uiinspect Display Methods, Properties & Callbacks Of An Object inspired this file.

This file inspired Check4updates and File Exchange Library Builder.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
21 Feb 2013 Thierry Dalon

Great idea!
Experienced with the automatic update feature for uiinspect:
It would be nice if before the update download you could check if the fileattrib is read-only. In this case the update fails.
You could remove the Readonly flag without asking since if the user wants to update he wants to overwrite the old version.
Reason of Read-only flag comes from Version Management Tool. (If file is checked-in it is set to Read-only.)
Most of the time I forget to check-out when I am asked for the update and happily trigger it.
This is only one line code to add: fileattrib(file,'+w').

21 Feb 2013 1.1

Ensure file is writable before updating (Thierry Dalon); increased FEX grace period 2=>3 days

Contact us