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!

angulus
Posts: 5
Joined: Tue May 13, 2008 5:10 pm

Search For File - Before Install

My Situation is I have an old copy of InstallSheild with redistributed copies of our program to our customers. The file is not MSI and it does not get the upgrade code from the EXE Install I selected. The easiest thing I can think of is to search for a the main exe in the common AppDir and check the version number. If the version is less then say 6.0 I would like to force the user to uninstall the previous versions first, VIA msgbox or custom dialog form. Your thoughts please......
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Search For File - Before Install

Hi,
The easiest thing I can think of is to search for a the main exe in the common AppDir and check the version number. If the version is less then say 6.0 I would like to force the user to uninstall the previous versions first, VIA msgbox or custom dialog form.
This can be done by using the result of a search as a custom launch condition. Here are the steps:
- go to the Search page and create a New File Search
- configure the search to find the file you want (for example "my_app.exe")
- set the "Max Version" field to the version which is just under the minimum allowed version of the file (for example, if the minimum allowed version is 6.0 you should use 5.9 for the search)
- rename the search to something meaningful (for example "OLDVERSION")
- right-click the search and use the "Add Location" -> "Folder" menu to add the folder in which the search will be performed
- go to the Custom Launch Conditions tab of the "Prerequisites" page
- add this custom launch condition:

Code: Select all

NOT OLDVERSION                      Please uninstall the old version of the application before running this package.
This way, if the search doesn't find the file (it is not installed or the version is higher than the maximum -> 5.9) the package will run. If the search finds a file, then it's version is lower than the minimum allowed version and the installation will stop.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
angulus
Posts: 5
Joined: Tue May 13, 2008 5:10 pm

Re: Search For File - Before Install

I just got it to work thank you very much.....
angulus
Posts: 5
Joined: Tue May 13, 2008 5:10 pm

Re: Search For File - Before Install

Ok I stand corrected.... lol
It works but when I uninstalled the old application the exe files are gone of course but now it still keeps asking me to uninstall it first. Ideas?
angulus
Posts: 5
Joined: Tue May 13, 2008 5:10 pm

Re: Search For File - Before Install

Nevermind I think i figured it out.... Changed the Depth Level from 5 to 3

Does the Depth level start from C:\ or from [AppDir]
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Search For File - Before Install

Hi,
Does the Depth level start from C:\ or from [AppDir]
The Depth level starts from the folder in which the search will be performed. For example, if the search will be performed in the "C:\My Folder" directory and the depth is 0, the search will try to find the file only in "C:\My Folder" (it will not search in it's subfolders or it's parent folder).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jledhead
Posts: 9
Joined: Thu May 08, 2008 1:22 pm

Re: Search For File - Before Install

I am having some problems getting this to work. I have a program that I am trying to apply a patch to and I only want to apply the patch to certain versions of this product. So I created my msi and added my files. I created a search to look for the exe and set the min and max versions just below the version I want patched. I then created a custom launch condition, this is where I am not sure if I did it right. for the properties of this condition, the expression is NOT NAMEOFSEARCH, and it validates. but this doesn't stop the install from running in any way.

Any help is appreciated.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Search For File - Before Install

Hi,

Please note that a patch does not use launch conditions (it is always applied to it's target images). However, a patch is designed for one or more target images. If a target image is not found on the target machine, the patch is not applied.

Therefore, the solution is to set the supported package versions as targets for the patch. This way, the patch will be applied only for the packages you want.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”