we already have a product that has been installed on customers machines with AI, now we are going to release another product that needs to be installed in the same folder as existing product and it should only be installed if the file version of the already installed product's main exe is same as the main exe of new product which is to be installed. (mind you these are totally different products not an upgrade)
So i was thinking i can use custom launch condition to achieve this but i have a few issues here
1. The existing product on users machine could have been installed anywhere as we let them choose their location from the customize dialog so i can not use search here. Is there a way i can ask the user to select the folder where previous product is installed or does AI leave any info on the machine (like registry etc.) from where i can figure out the previous product's install location?
2. Even when i find out the location of previous products I still need to compare the file versions of the main exes, one that is already installed and the other that is in the package that is going to be installed. so i thought i could use vbscript to do this by querying the msi database by using the following code
Set xInst = CreateObject("WindowsInstaller.Installer")
Set xDB = xInst.OpenDatabase("D:\New Folder\My.msi", 1)
Set xView = xDB.OpenView("SELECT Version FROM File WHERE File = 'My.exe'")
Call xView.Execute
Set record = xView.Fetch
If NOT record Is Nothing Then
MsgBox record.StringData(1)
End If
Set xView = Nothing
Set xDB = Nothing
Set xInst = Nothing
But i dont know how will I pass in the path to the msi from within the installer.
Can somebody please help? I am going in the right direction or have i made it all too difficult for myself and there is an easier way to do this.
FOLLOW US
Get the latest news in Application Packaging