tags:

views:

174

answers:

2

We have an application which we licence to separate companies. The app is customised to fit their brand; basically it is the same app but with a different theme file. We generate separate installers for each vendor as each app requires different configurations (servers to connect to, updates etc).

So each installer contains the same compiled application but with different configurations. All of this is managed by our build system so adding a new vendor is just a matter of creating a new theme and a simple include script for Inno Setup.

Our problem is that we want to ensure that when a user installs the app from vendor A they will not be able to install it from vendor B unless they explicitly uninstall the existing app.

Is there some setting in Inno Setup which will check if there is an existing installation (either from the same vendor or a different one) and tell the user they have to remove the existing installation?

A: 

you can manually select which brand you want to install but you can not set brand then file ...

only ask user to select brand .... never provide them to choose file .. and add diffrent binary with diffrent brand ..

Avinash
A: 

A setup will always check whether there is a previous installation with the same AppID, if it finds one it will not create a new entry in the software applet, new data for uninstallation etc., it will instead update the previous installation with the new files and settings, merge the new data into the existing, and keep the single entry in the software applet.

So as long as you have the same AppId for all your different brands it is impossible for two configurations / brands to be installed on the same system. Now instead of cancelling the running installation you should probably simply make your installer smart enough to deal with this on its own.

Use Inno Setup scripting to check whether there is a previous installation of a different brand, or whether the current brand is being updated. You can use the SetPreviousData() and GetPreviousData() support functions to save some data to the registry which is unique to a brand, and test for it in one of the Setup initialization event functions (see the documentation). If the previously saved data matches the brand which is about to be installed you can simply proceed to update the installation. If it is different you could ask the user whether to cancel or to replace the installed brand.

mghie