Testing for old install before installing - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

Testing for old install before installing

We have a product that we have previously been distributing using Ghost Installer. That installer had many bugs and limitations we couldn't work with anymore, so are preparing a big release in which we are using AI 4.1.1.

We have an AI project all set up that does everything we need to on a fresh system, however, to reduce confusion and possible erros, I would like to have the user uninstall the old version (ghost installer built) before installing the new version (that will use AI).

I know I can check the HKLM\Software\Microsoft\Windows\Current Version\Uninstall\{AppID} registry key to see if the old install is there, and to find the information needed to run the uninstall for it.

What is the best way to go about implimenting this? I know I can use that registry key to set a user defined property, but where should I go from there. Should I make it a launch condition? Is there a way to make a UI panel that only appears if if that key is found and then cancels the install if it is?

Thanks for the help and the great product.
jbridges
Posts: 38
Joined: Fri Jun 09, 2006 12:36 am

I have a method that works

Under Search, I created a RegLocator search for the full path to DisplayName. For example:

Code: Select all

SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{01B49069-6F82-4587-9839-E8D81D02516B}
Use DisplayName as the value for "Name"

Then create a Launch Condition based upon the content of the Property Created - say RESULT_PROPERTY

Make the Launch condition that some keyword that you expect to find is NOT there. In our case, we always use the Company name as part of the DisplayName.

So the condition looks something like:

Code: Select all

 
NOT RESULT_PROPERTY >< "MyCompany"
In our case, I had to search for multiple versions, each of which had a different GUID under the Uninstall subkey (see above). So I had multiple searches and multiple launch conditions each of the variety above.

By searching for a keyword that you expect, if you don't find it, then it could be because the subkey itself is not there. This is exactly what I wanted. This should work because most "normal" apps always have a DisplayName - so your apps probably do as well.

This technique has worked well under my tests so far. I hope someone corrects me if I have misunderstood something. I have used it to find 4 different prior versions of our product.
DrJones
Posts: 18
Joined: Wed Jun 28, 2006 10:00 pm

That information is very helpful.

Once you put it in a launch condition, from what I understand it will prevent the new instalation if the old one is found.

Is there any way to prompt some sort of message to the user in that case so they know why the install isn't going properly?
jbridges
Posts: 38
Joined: Fri Jun 09, 2006 12:36 am

use the description to give the user the prompt

When you are creating the Launch Condition, you use a popup menu which asks you for the Condition and the Description. I showed you the condition. If you put a Description like:

Code: Select all

[RESULT_PROPERTY] is installed. You must uninstall it prior to upgrade.
Then you have it. So, to make things more clear, use a property name more like MyFramusVer3_0 - or some such. Note that the bracket property is derefenced and it will include the actual value of the DisplayName found as a result of the search.

The way I found out all this stuff is to use the "Run and Log" button on the IDE. The log makes it really clear what is happening. If you use this, most of the time, you can figure out whatever you need. At least that's my experience so far. I've been using this product about 3 weeks or so and really like it.

I also purchased the book "The Definitive Guide to the Windows Installer" by Phil Wilson. This makes the Platform SDK easier to understand. As the support team has pointed out numerous times, a great many of the questions that users ask are actually answered in the Microsoft document for the Platform SDK.

Return to “Common Problems”