Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Help Evaluating a build version


3 replies to this topic

newport

newport
  • Members
  • 13 posts

Posted 05 December 2002 - 17:43

Hello, I am using InstallShield 6.3. I have read a version number from the registry and it is 2.1.3. I want to make a condition that will make sure version 2.1.3 or higher is installed. This will include such variations like 2.1.4 and 2.2.0

Can someone please lend me some insite?
Thanks in advance!
~Chris

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 05 December 2002 - 19:21

You can use the built-in IS function called VerCompare.  See the IS help file for more information.
user posted image

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 05 December 2002 - 20:04

This is the code I use to check previous versions of our install and to make sure my Patch is going to run only on previous versions.  Note: I use a list because there could be multiple patches.  You probably won't need to do that and can use a string constant
Code Sample
// Check Previous version to make sure we are installing a higher version
   listResults = ListCreate(STRINGLIST);
   RegDBQueryKey("SOFTWARE\\Our Company\\Our Product",REGDB_KEYS,listResults);
   nCount = ListCount(listResults);
   NumToStr(sCount,nCount);
   nLast = nCount -1;
   ListSetIndex(listResults, nLast);
   ListCurrentString(listResults,sLastInstall);
   sCurrentInstall = @Product_Version;
   nResult = StrCompare(sLastInstall, sCurrentInstall);
    //results from StrComp: below zero A less than B; zero - equal;
    // over zero - A greater than B
   if (nResult > 0) then
    MessageBox(szMsg6 + szMsg7, INFORMATION);
    abort;
   endif;
   ListDestroy(listResults);


HTH
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

newport

newport
  • Members
  • 13 posts

Posted 05 December 2002 - 23:32

THANKS TO BOTH...