Uninstall existing product which was not installed by MSI - 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!

cajin2
Posts: 8
Joined: Thu May 17, 2007 12:14 am

Uninstall existing product which was not installed by MSI

I have existing installation of my program on several computers. They were not installed by windows installer before - Manually copied files to the computers and installed service with installutil.

I am trying to create an installer for this application. That means, in the feature, my computers may have two different installations: some are installed manaully, others are installed by the installer. I hope the installer can detect current installation. If it is not installed by windows installer, delete the files immediately but save some configuration files. If it is installed by windows installer, I guess the installer itself knows when and how to delete the files, so I need only to save the configuration files.

My questions are,

How to write a .exe custom action to delete if the existing program is installed manually or installed by windows installer? I think I can use MSI functions to detect if it is installed by windows installer. But I hope Advanced installer can do it easily so I don't have to write the code.

How to set run condition for this custom action?

Thanks.

cajin2
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Windows Installer detects older version of a product when "FindRelatedProducts" standard actions reaches. Since the product was not registered using Windows Installer you need a way to detect if it's already installed or not. This can be done with a file, folder or registry search in the AI "Search" page:
http://www.advancedinstaller.com/user-guide/search.html

After you detect the location where the older program resides you can create a custom action to remove it. Since the custom action needs to be executed only if the older program was found you need to condition its execution with the search property (RESULT_PROPERTY by default) created above. Schedule the custom action under the "AppSearch" action. Read more about how to use custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

To remove the older service you can use a "Control Operation" in the AI "Services" page:
http://www.advancedinstaller.com/user-g ... rties.html

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”