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!

Smedman
Posts: 3
Joined: Mon Oct 22, 2007 2:45 pm

Execute a Custom Action depending on search result.

Hello.
We have packaged our software with inidigorose setup facotry 6 earlier and now we are thinking of switching to Advanced Installer. We always installed our software to C:\Product\Engine (set hard inside package) and there we have a service.exe. The InstallDir was written to registry (HKLM\SOFTWARE\OurProduct,InstallDir="C:\Product\Engine\")

I now wonder how I can check the registry for the InstallDir which should return C:\Product\Engine\Service.exe for previous version than the one we are currently building which will be installed to [ProgramFilesFolder]\Product\Engine\Service.exe. If the InstallDir value is C:\Product\Engine\Service.exe then I want to perform a Service Uninstall action or at least show a messagebox that previous version needs to be uninstalled.

Any chance to accomplish this? I can not figure it out...

Thanks.
Anders Smedman
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

There are two ways to do this:

1) You upgrade the older installation. In the "Upgrades" page you create a new upgrade using the MSI of the older installation.

Please note that this can be done only if the older installation is MSI based and it will automatically uninstall the service.

2) In the searches page you create a search for the "Service.exe" file like this:
- use the "New File Search" menu to create a search
- set the "Name" field to "Service.exe"
- use the "Add Location" menu to search into a specific folder
- for that folder you set the "Path" field to [WindowsVolume] and the "Depth" field to 3 (in the "Directory Properties" page).

In the "Custom actions" page you create a "Launch file or open URL" custom action which uninstalls the service or you use an "Error Message" custom action to notify the user. The custom action will have the "Expression" field (in the "Execution Condition" section) set to RESULT_PROPERTY="C:\Product\Engine\Service.exe"

Let me know if you encounter any problems.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Smedman
Posts: 3
Joined: Mon Oct 22, 2007 2:45 pm

Thanks, that gave me a couple of things to play around. I will evaluate it and come back to you if I have any more questions.

Thank you for your support.

Return to “Common Problems”