contichris
Posts: 6
Joined: Tue Jan 17, 2023 8:31 am

Create shortcut depending on feature selection

Wed Feb 01, 2023 8:44 am

Hi there,
i am using AI 16.6.1 and created an Enterprise project.
Let's say in my project, next to others there are two features (e.g. A and B) that contain the same tool (exe-file). Is there a way to just put one of those files in the installation output depending on which feature the user selects? For example, always put the exe file from feature A in the install directory unless the user deselects feature A but wants to install feature B.
Moreover, since the tool is the same I ideally create just one shortcut for it. Means, the shourtcut's target should always lead to the exe-file of feature A unless the user deselcts A but wants B. In case of selecting just feature B the shortcut's target should of course lead to feature B's exe file.

Best regards
Chris

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Create shortcut depending on feature selection

Wed Feb 01, 2023 4:54 pm

Hello Chris and welcome to our forums,

Here is how you could achieve that:

- in the "Files and Folders" page, create two folders for your executable, say 1 and 2

- add your executable once in each folder
Screenshot_61.png
Screenshot_61.png (17.48KiB)Viewed 5146 times
Screenshot_62.png
Screenshot_62.png (17.37KiB)Viewed 5146 times

- for each folder, right click on it --> "Properties" --> "Install folder content into the parent folder"
Screenshot_63.png
Screenshot_63.png (16.77KiB)Viewed 5146 times

This way, we can add the file twice in our project.

Now, in "Organization" page, we should add each component to separate features.
Screenshot_64.png
Screenshot_64.png (21.68KiB)Viewed 5146 times

You can then condition each feature to be installed as per your needs.

Regarding to shortcut, you can proceed as it follows:

- go to "Files and Folders" page

- click on the first executable --> "New Shortcut To" --> "Installed File"
Screenshot_65.png
Screenshot_65.png (18.58KiB)Viewed 5146 times

If you have them in the same folder, please make sure you give them different names.

- repeat for the second executable

Now, in the "Organization" page, the shortcut should have been added under the component of each executable, meaning it will only be installed if the EXE is installed.
Screenshot_66.png
Screenshot_66.png (37.95KiB)Viewed 5146 times

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

contichris
Posts: 6
Joined: Tue Jan 17, 2023 8:31 am

Re: Create shortcut depending on feature selection

Fri Feb 03, 2023 3:09 pm

Thank you for the very good explanations but I think the problem ist that I cannot configure a condition on sample.exe_1 which depends on the selection of Feature1. So as I can see I just can add conditions based on the states but not on the actions. I think I would need something like:
-don't install sample.exe_1 if Feature1 is selected for installation
Wouldn't that be something like:
- NOT &Feature1 = 3

Regards
Chris

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Create shortcut depending on feature selection

Fri Feb 03, 2023 4:56 pm

Hello Chris,

I'm a little bit confused here, I thought you give the choice to your user to choose whether he wants 1 or 2 to be installed (through a checkbox, for instance).

Why would you need to condition 2 based on the state of 1? I can't see a valid scenario for you wanting the same executable twice in your project and conditioning one based on the other.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”