+ Reply to Thread
Results 1 to 8 of 8

Thread: Checking Local Version to overwrite file

  1. #1

    Default Checking Local Version to overwrite file

    I am using automatic updates (wupdate) and would like to install a new file only if the customer is on a version prior to 23.01.27 (the file will contain critical data if the customer is on a version after that). I have done the following:

    ! at top of script where all variables are registered:
    Set Variable %_SB_PARAM5% to FUNCTIONetect Previous Version ("{7D3B3610-30D4-11DD-66BB-048967B36443}")

    ! Under Install Files:

    If %_SB_PARAM5% Less Than or Equal "23.01.26" Then
    Install File(s) "C:\32bitpabp\Flashver23\data\UsPayTab.adt" to "%_SB_INSTALLDIR%\flash\data\UsPayTab.adt" [Feature:Always Install]
    Install File(s) "C:\32bitpabp\Flashver23\data\paytable.adi" to "%_SB_INSTALLDIR%\flash\data\paytable.adi" [Feature:Always Install]
    Install File(s) "C:\32bitpabp\Flashver23\data\paytable.adt" to "%_SB_INSTALLDIR%\flash\data\paytable.adt" [Feature:Always Install]
    End

    Even if I set the Local_Version flag in the registry to 23.01.27 the file is still overwritten. Any one know what I am missing?

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking Local Version to overwrite file

    Hi Steve,

    The "Detect Previous Version" function returns the path of a previously distributed version of your product.

    If the function succeeds, %_SB_RETURNEX% contains the installed version number (if available).

    I have attached a screenshot with a code snippet on how to handle it.

    Does this help?

    Friedrich
    Attached Images Attached Images  

  3. #3

    Default Re: Checking Local Version to overwrite file

    Where does the returned version come from?
    I have:
    Set Variable %DEV_VER% to FUNCTIONetect Previous Version ("{7D3B3610-30D4-11DD-66BB-048967B36443}")
    Set Variable %INSTALLED_VERSION% to "%_SB_RETURNEX%"

    If %INSTALLED_VERSION% Less Than "23.01.26" Then
    Install File(s) "C:\32bitpabp\Flashver23\data\UsPayTab.adt" to "%_SB_INSTALLDIR%\flash\data\UsPayTab.adt" [Feature:Always Install]
    Install File(s) "C:\32bitpabp\Flashver23\data\paytable.adi" to "%_SB_INSTALLDIR%\flash\data\paytable.adi" [Feature:Always Install]
    Install File(s) "C:\32bitpabp\Flashver23\data\paytable.adt" to "%_SB_INSTALLDIR%\flash\data\paytable.adt" [Feature:Always Install]
    End

    I have attached an image with what is set in registry:
    Name:  regsetup.JPG
Views: 286
Size:  89.8 KB

  4. #4

    Default Re: Checking Local Version to overwrite file

    Ok after more testing, I am still having problems. To test I have the installer sending back what is set in the flag and displaying a message box. If I have the following (I know the flag is set to 23.01.25 as I have it showing in the heading):

    If %INSTALLED_VERSION% Less Than "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% is less than 23.01.26", "") [Noisy]
    End
    If %INSTALLED_VERSION% Equals "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% equal to 23.01.26", "") [Noisy]
    End
    If %INSTALLED_VERSION% Greater Than "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% more than 23.01.26", "") [Noisy]
    End

    I get no message boxes with the above, so I tried:

    If %INSTALLED_VERSION% Less Than or Equal "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% is less than 23.01.26", "") [Noisy]
    End
    If %INSTALLED_VERSION% Equals "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% equal to 23.01.26", "") [Noisy]
    End
    If %INSTALLED_VERSION% Greater Than or Equal "23.01.26" Then
    Display Message Box ("Flag %INSTALLED_VERSION% more than 23.01.26", "") [Noisy]
    End

    and I get both the attached message boxes.Name:  greaterthanorequal.JPG
Views: 328
Size:  14.2 KBName:  lessthanorequal.JPG
Views: 255
Size:  14.2 KB.

    Any ideas, I am baffled.

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking Local Version to overwrite file

    Steve,

    please see my previous screenshot. You are using the wrong Condition. Please use "Version Less Than..." !!!

    Does this help?

    Friedrich

  6. #6
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking Local Version to overwrite file

    Steve,

    The "Detect Previous Version" function uses the Product GUID of previously distributed versions to determine if the application is installed on the client. It only works if the previous installation created a Product GUID (code) in the following section of the Windows registry:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\Uninstall

    SetupBuilder automatically creates this item if the Add/Remove Programs Support option is enabled in the "General Information" Visualizer.

    The above installation information is a Windows development guidelines requirement.

    Friedrich

  7. #7

    Default Re: Checking Local Version to overwrite file

    You are correct, I had the wrong flag set. Works great now, Thank you

  8. #8
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking Local Version to overwrite file

    Perfect! Thanks for the update, Steve.

    Friedrich

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •