cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shawn_eckley
Level 3

Downgrade is not removing the files from installation i am downgrading from.

Hi All;
I am trying to get my installer project setup so that a user will be able to downgrade to an older version of our application if need be. I have removed the ispreventdowngrade object from my MSI projects and set the "Upgrade Windows Installer Setup" on the "Upgrades" page , to "Completely Uninstall old setup before installing new setup" and "Don't prompt the user, just install the upgrade". However when I run the downgrade the dlls that were installed as part of the installation I am downgrading from stay on the system.
Say I have v60 of our product installed and I want to downgrade to v59. I run the v59 installer and when it is completed I look in the product folders and see all our dlls with the v60 version. they should have been removed. when I look at the entry for our app in the control panel-->"uninstall a program" I see our product listed with the v59 version.

What could be causing the dlls to not be swapped out?
Labels (1)
0 Kudos
(4) Replies
phanik
Level 6

Ideally you should not do the steps whatever you are following to provide downgrade support, Installshield itself does not provide the facility of downgrades.

1. If you really need to support downgrades , you can provide a VB script to customers along with your products setup.exe, it should do the actions like uninstall the installed product based on GUID and install latest product.

2. As You are saying Add/remove programs entries are updated but not dll files in installed location, when you used your hack/crack/technique/work_around , you can remove all files by writing custom action, in that if necessary u need to unregister the dlls before delete.you did not mention whether registry entries are downgraded are not

option1 is safe I feel.


regards,
Phanik
0 Kudos
shawn_eckley
Level 3

phanik wrote:
you did not mention whether registry entries are downgraded are not


Hi Phanik;
The DLLs are not registered, so that is not an issue. The registry entries that i put in through the installer are changed by the downgrade. I think i'm going to have to go with your option 1. I've tried the steps that Installshield Tech support have mentioned, adding a Major Upgrade Item, and it did not work.


Thanks

Shawn
0 Kudos
DLee65
Level 13

I suspect that if you mark your components as 'always overwrite' then a 'downgrade' may work. This is because it should ignore component rules of not overwriting a file with a higher version.

In the end if any of our clients wanted to 'downgrade' then the typical response is to uninstall the current version and install the version they desire.
0 Kudos
phanik
Level 6

"always overwrite" option may or may not serve your purpose but in future if you make patch for your product , you will be in to another problem and patch upgrade does not work.

as you said u prefer option1: vb script , I am providing you piece of code. it may help you.



UNINSTALL

--------------------------------------------------------------------

Function UNINSTALL()

Const prod_GID = "your_product_GUID"
Const prod_GID1 = "your_product_GUID1"
Const prod_GID2 = "your_product_GUID2"

'if ur product was released several times with different GUIDs then u can add above statements.


strUninstallKey = "HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\"

strprod_GID = strUninstallKey & prod_GID & "\"


Set winInstaller = CreateObject("WindowsInstaller.Installer")
winInstaller.UILevel = 2

bprod_GID = False

If ( Len(GetRegKeyValue(strUninstallKey & prod_GID & "\UninstallString")) > 3) then
bprod_GID = True
End If

If ( (bprod_GID = TRUE) ) then
'wscript.echo "your product Already installed"

If ( bprod_GID = True ) then
winInstaller.UILevel = 2

iRC = winInstaller.ConfigureProduct(prod_GID, 0, 2)
If Err.number <> 0 then
' ur message
End If

If iRC <> 0 then
' ur message
End If
End If
End If

Set winInstaller = Nothing

'add ur code from here to install ur new product

End Function




Function GetRegKeyValue(ByVal sRegKey)

GetRegKeyValue = ""
On Error Resume Next
Err.Clear

GetRegKeyValue = objShell.RegRead(sRegKey)

On Error Goto 0

End Function

'------------------------------------
0 Kudos