PDA

View Full Version : How can I force an update if new version is lower than installed version?



Stein Inge
10-01-2008, 12:24 PM
This question might sounds a bit stupid and I feel that I have painted myself a bit into a corner. The situation is that my current version is called 2007.x.xxx while my new version is 8.0.xxx. So it’s a bit difficult to tell TrueUpdate that v8 is actually newer then v2007. If you have any suggestions to how I can fix this, I would be very, very happy. This is what I have tried, but it did not work.


------------------------------------------
-- Identify the Installed Version
------------------------------------------

-- Read the installed version information from the registry
g_InstalledVersion = Registry.GetValue(g_RegMainKey, g_RegSubKey, g_RegValueName);
error = Application.GetLastError();
if(error ~= 0) then
SessionVar.Set("%ErrorMessage%", TrueUpdate.GetLocalizedString("ERR_DETECT_VERSION_FAILED").."\r\n".._tblErrorMessages[error]);
Screen.Show("Update Failed");
Application.ExitScript();
end

-- If the installed version is older than the target version, we need to perform the update
local nSpecialVerTest = String.ToNumber( String.GetWordNum( g_InstalledVersion, 1, ".") ) ;
if nSpecialVerTest <= 2007 and nSpecialVerTest > 1990 then
gUpdateRequired = true;
elseif(String.CompareFileVersions(g_InstalledVersi on, g_TargetVersion) == -1) then
g_UpdateRequired = true;
else
g_UpdateRequired = false;
end

-- Exit if an update isn't required
if not g_UpdateRequired then
Screen.Show("Update Not Required");
Application.ExitScript();
end

best regards
Stein Inge Haaland

jassing
10-01-2008, 10:42 PM
Stein - I'm sorry my "fix" didn't work for you.
Since I "warranty" all my work -- I want to get you going ...

I have sent you several emails (no response) on how to replicate it -- I have never had an install that I could test with -- if you would email me a link that I can download the "old version" I can test the update process..

if you've fixed the "name change" issue; the code I provided should have taken care of your "version scheme" change (2007.x.x.x to 8.x.x.x)

Please email me with details and I will work with you to resolve this new issue (version # scheme change) at no-charge.

-josh

Stein Inge
10-02-2008, 01:22 AM
Not to worry Josh :cool The coding you have done for me so far is 100% good. This is a new issue that I was not aware of or did not think of when choosing version numbers.

Your e-mails have arrived but since we live on different sides of this globe, I was well asleep when you where buisy working.

I have sent you a private e-mail and I assume you will have fixed this in no time when you get up in the morning. I'm very happy with all your work so far, so dont worry my friend :lol

best regards
Stein Inge Haaland, up north at the snowy and cold little Norway