PDA

View Full Version : How to detect the previous version of one installer from other one



avsaravanan
12-09-2013, 11:36 PM
Hi,

I have one child installer which gets installed as part of its parent installer. Some time the child installer can be installed alone. At that time how to verify it from parent installer whether the child is installed or not?. If it is I need to uninstall it and reinstall them. How to do it?

Is 'Detect previous version' function useful?

Note : It is not registered in windows registry. But I know the GUID of both.

linder
12-10-2013, 02:17 AM
Hello,

to comply with the Windows Install/Uninstall requirements, you have to "register" the installed application in the Add/Remove (Programs and Features) control panel. This will write the Product GUID along with product specific information to the appropriate places (so it can be uninstalled later via Add/Remove). If you don't use the Add/Remove Programs feature then you can't detect the installed application because it is not registered with Windows.

I assume that you are using the above mentioned feature (it is enabled by default). The "Detect Previous Version..." function lets you detect the path of a previously distributed version of your product. If the function succeeds, the %_SB_ERRORCODE% return value is nonzero (means: the application is already installed). The variable used in this script function contains the path to the previous version. %_SB_TMP% contains the uninstall string (if available). %_SB_RETURNEX% contains the installed version number (if available).

You can simply use the %_SB_TMP% variable in "Run Command Line..." to uninstall the previously installed version.

Does this help?

Friedrich

avsaravanan
12-10-2013, 03:52 AM
Thanks!.
Yes I have done as you said. That is, my application is getting added in Add/Remove program. I have "Detect Previous version" function implemented in my child installer for its GUID. and It detects properly If it is already installed.
Now I want to implement the samething in my parent installer where I need to detect the child application whether it is already installed or not?.

In that, can I detect GUID of child application from parent installer?

Regards
A Vijayasaravanan

linder
12-10-2013, 04:08 AM
Hello,

If the "child" install has its own Product GUID, then yes. You can use the same method to detect it. If it does not have its own Product GUID then Windows does not know nothing about it. Then the only way to "detect" it is to see if "child" specific files are already there with a specific version resource (because you said you do not write anything to the Registry). You can use "If File/Folder Exists..." and/or "Get File Info (Version Resource)...".

BTW, if you have access to the "child" install sources and it does not have its own Product GUID, just let the "child" install write a simple registry footstep to the "main" installs Product GUID registry key (e.g. AddOnVersion=1.2.3.4) and you can detect it without an unique GUID.

Friedrich