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!

ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Multiple searches and install in each one

Hi,
First time here. I'm trying to build an MSI installer for a plugin for the company I work at.
The requirements are as follow:
-search for specified version of product (there are 4 products for which this plugin is availabile)
-set directory from searches (for 2 products the location is in the registry and for the other the location is in appdatafolder)

This I have done and works wonderfully. The installer checks for all of these versions and if you have at least one, it installs in the found directory. If you have more versions of this product it installs in the last one checked that returned true.
What I'm trying to do is to search for locations and install in each one I've found and preferably in one install.
Could I display all the found directories in a dialog (UI) ?
Can I make only one installer for both x86 and x64 keeping in mind that I search registries and folder paths?

Note: I'm doing searches from the Custom Behaviour -> Searches and APPDIR property change from Custom Actions -> Set Directory Path.
I'm using AI 11.8

Thanks.
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

So I partially done this. I added new property folders in Files and Folders. Now the issue is that it installs in a random location if I don't have the software for which the plugin is meant, installed.
Let's say the software is installed in C:\ProgramFiles by default. It installs there. If I don't have the program, it installs in D:\ for all the verions.
How do I install only if I find a valid path?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi and welcome to Advanced Installer forums.

If you want to condition the installation of some files, you can go in the "Organization" page, select the components related to those files and set a condition for them in the "Condition" field. For instance, you can user your search properties as conditions (i.e. MY_SEARCH_1).

You can also set conditions for the features that are available there by using the "Add Install-time Conditions" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

Thank you for your reply. I tried that and it didn't work.

I'll explain with more detail so you can get a better idea of what I'm trying to accomplish.
I have a folder with a sub-folder and a file, this is what i'm installing. It's a plugin for a program. The program has 4 versions. A user can have none, one or more verions of this program. In case the user has none, I'll show an error and stop the installation. If the user has one I'll search the path of that program and install a copy in a specific location. If the user has 2 verions of the program, I'll search for them and install two copies of the same files in different paths.
My problems are:
- if it doesn't find any verions of the program, it installs in D:\
- if it finds a verion, it installs there and for the other 3 verions it installs in D:\
- I've read about how AI can duplicate files (in File and Folders) this helps me but I can't seem to duplicate a whole folder with all of the folders and files inside it.
So basically I'm installing the same thing for all verions that it finds. I've put the search condition in the Organization page but it doesn't do nothing :(
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi,

In order to achieve what you want, you can follow the steps below:
- create 4 searches for your 4 versions (you already did this)
- create 4 property-based folders that use the 4 searches (one folder for each search)
- add the appropriate files and folders to each property-based folder
- go in the "Organization" page and set a conditions for each file and folder based on your searches (i.e. for folder 1 set "MY_SEARCH_1" as a condition)
- go in the "Launch Conditions" page, "Custom" tab, add a new custom launch condition
- set the search properties as a condition for it (i.e. MY_SEARCH_1 OR MY_SEARCH_2 OR MY_SEARCH_3 OR MY_SEARCH_4)
- build and run the project

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

I did exactly as instructed. If it finds a version it installs in the corect path for that one, the rest defautls to D:\SEARCH_PROPERTY_NAME
Edit: If I don't have any verion it doesn't install (based on the condition you suggested)
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi,
I did exactly as instructed. If it finds a version it installs in the corect path for that one, the rest defautls to D:\SEARCH_PROPERTY_NAME
This happens if you did not set the correct conditions for the components (or features) from the "Organization" page. Can you send me your AIP file to support at advancedinstaller dot com, so I can take a look of it?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

I checked and re-checked the Organization page. I sent the file if you could look at it. Thanks a lot!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi,

After I looked over the AIP and the log files that you sent, I discovered the problem and I will explain it below.

If a property that is used by a property-based folder, is empty during the installation, we automatically set a drive (the drive with the most free space) and its name (the property name) as a value (path) for that property. We do this because Windows Installer does not support a folder with no path and it throws an error in this case. Sorry because I missed this from the beginning.

So, during the installation when those properties are set to the values mentioned above, the conditions for your folders become TRUE and that is why the folders are installed.

In order to overcome this problem, you need to use different properties for your property-based folders, than the search properties. To achieve this, you can create, in the "Install Parameters" page, another 4 properties that will be used for your folders, then go in the Custom action page and add 4 "Set installer property" custom actions after the "Wizard Dialogs Stage -> Searches" action group as in the example below:
  • Property: MY_FOLDER_1
    Value: [MY_SEARCH_1] (the value of the search)
- while the "SHIFT" keyboard button is pressed, drag and drop the 4 custom actions after the "Install Execution Stage -> Searches" action group, to duplicate them (this is necessary in case you will install your application in Basic or Silent mode)
- click on the "Advanced execution scenarios..." blue link and check the "Skip action in Install Execution Stage if executed in Dialogs Stage" option
- go in the "Organization" page and set again the appropriate conditions for your components, using the same search properties

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

This is wonderful. I discovered this solution on my own just minutes before I received your mail. One suggestion to your solution: you need to add SEARCH_1 to SetInstallerProperty_1 condition otherwise it won't work.
Thank you very much for your help(thus far).
Now I have a different problem: I need to uninstall an old version of this product of which I DON"T know the GUID's or anything. I just have an exe of the old version. I converted the .exe to .msi with AI the in my original project I imported the .msi in Upgrades page. But it doesn't work :(. Any ideas as of why?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi,

I'm glad you found and resolved the problem.
Now I have a different problem: I need to uninstall an old version of this product of which I DON"T know the GUID's or anything. I just have an exe of the old version. I converted the .exe to .msi with AI the in my original project I imported the .msi in Upgrades page. But it doesn't work . Any ideas as of why?
I'm afraid that in order to be able to uninstall an application you need its related Upgrade Code or Product Code. Otherwise, you need an uninstall executable and run it during the installation of your package.

Normally, each package creates some registry entries during the installation storing some information that should also contain the Upgrade Code and/or the Product Code.

You can try to make a diff between the registry entries available before and after the installation of that package and see if you can find the necessary codes. You can also send me a link to download that package and try to find its related codes (if it has any).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ogrishmania
Posts: 10
Joined: Tue Feb 10, 2015 3:47 pm

Re: Multiple searches and install in each one

New problem. I have the AIP project and all is working perfectly. In Install Parameters Page I have 4 properties (folders) for each version. When I close Advanced Installer and reopen the .AIP file now it shows 8 properties (it automatically adds the searches) and when I build and run it crashes with "Could not access network location SEARCH_1". What is happening? Why isn't it working anymore? If I try to delete the search proprieties from Install Parameters it says that they have dependencies (the Property based folder, the custom action (set installer property) and "AppSearch"). The only solution is to remake the project from scratch and never open the .aip file again...

EDIT: I think I solved this. The Search properties were added like this Name: SEARCH_1 | Value: SEARCH_1. I changed the value to some random path and apparently it works.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple searches and install in each one

Hi,

Yes, setting a valid path for those properties is the recommended solution.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”