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 FUNCTION:Detect 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?
1 Attachment(s)
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
1 Attachment(s)
Re: Checking Local Version to overwrite file
Where does the returned version come from?
I have:
Set Variable %DEV_VER% to FUNCTION:Detect 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:
Attachment 4630
2 Attachment(s)
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.Attachment 4631Attachment 4632.
Any ideas, I am baffled.
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
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
Re: Checking Local Version to overwrite file
You are correct, I had the wrong flag set. Works great now, Thank you
Re: Checking Local Version to overwrite file
Perfect! Thanks for the update, Steve.
Friedrich