cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mjanulaitis1234
Level 4

How to stop 32-bit installer from over installing 64-bit version

I've got 2 install projects for the same product. Right now they have the same product code, although I can change them if I need to. My question is this. How do I stop the 32-bit version from over installing the 64-bit version and possibly vis-a-versa? I think I want, however; the 64-bit version to uninstall the 32-bit version if found. Seems the later is easy as I can just change my product code.
Labels (1)
0 Kudos
(2) Replies
Christoph
Level 8

make unique productcodes(as updatecode and packagecode) and fill the upgrade table to detect the 32-Bit product and visa versa.
0 Kudos
Videstra
Level 7

We have both 32 bit and 64 bit versions of the same application - which sounds like what you have. We prevent this by only allowing the 32 bit version to install on 32 bit system, not on 64 bit systems. Since a 64 bit installer will not even run on a 32 bit system we don't have to worry about that.
So - to prevent a 32 bit installer from installing on a 64 bit system I wrote a small, but simple Custom Action in VBS (Stored in binary table).


Option Explicit
'this custom action is designed to determine if the OS is 32 or 64 bit. It is meant to be included ONLY in 32 bit
'installs to warn the user when an actual 64-bit version of the application is available

Const IDABORT = 3
Const IDSUCCESS = 0

Dim strCaption

'AmI64Bit

Function AmI64Bit()

StrCaption = "32-bit OS"
On Error Resume Next
strCaption = GetObject("winmgmts:win32_OperatingSystem=@").OSArchitecture
On Error GoTo 0
If (InStr(strCaption, "64") > 0) Then

MsgBox "You are trying to install a 32 bit application onto a 64 Bit Operating System" & vbcrlf & _
"A 64-Bit version of this application is available." & vbcrlf & vbcrlf & _
"Please contact Customer Service for the 64 bit version of this application", vbOkOnly
AmI64Bit = IDABORT

Else

AmI64Bit = IDSUCCESS
'Call MsgBox(strCaption)

End if


End Function


This CA is placed in the 32 bit installer early in the process.
If this returns IDABORT then the CA will cause the installer to abort gracefully.

If you allow users to install 32 bit program on a 64 bit system when a 64 bit version is available then I think it just gets complicated...
0 Kudos