Join us for SoftSummit 2023. The 20th anniversary of the industry leading software monetization conference. April 18 and 20. Register Now

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
agshah
Level 6

How to share files between Features in InstallShield MSI InstallScript project?

Forlks,

How to share files between Features in InstallShield MSI InstallScript project?

I have some common files that I want in Feature A and B.
I added them to both features. But when I uninstall these common files are not getting removed.

What is the recommended way to share files between features.

thanks in advance.

Labels (1)
0 Kudos
5 Replies
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

Are the common files installing to the same directory? If so this would break Component Rules - https://learn.microsoft.com/en-us/windows/win32/msi/what-happens-if-the-component-rules-are-broken

"If two components have a resource under the same name and location and both components are installed into the same folder, then the removal of either component removes the common resource, which damages the remaining component."

0 Kudos

Hi,
Yes, the common files are installed at the same directory. Thanks for the link.

So any idea how to go about this? Appreciate any recommendations.

0 Kudos

Hi,
I was able to take below approach and seems to work. Would you please advise if this is acceptable?

Instead of including the common files (that have same name and location) in Feature A and B, I created a Feature C which includes these files. Feature C is not visible to the user but is a required Feature for Feature A and B. This seems to work, common files are getting installed and removed appropriately.

Appreciate your input.

0 Kudos
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

Perfect solution - and one that I would have suggested.
If further down the line things become more complex and more features are introduced which are optional and don't require the shared files - you can look into creating conditions for the Feature C to only install if specific other features are selected.

0 Kudos
messeacees234
Level 2

To share files between Features in an InstallShield MSI InstallScript project, you can use the "Shared" component feature.

First, create a new component in the Components view of the InstallShield project. Then, set the component's Shared property to "Yes". This will allow the component to be shared between different features.

Next, add the shared component to each feature that requires access to it. To do this, go to the Feature view of the InstallShield project, select the feature, and add the shared component to its Components list.

Once the shared component is added to multiple features, any file included in that component will be available to all features that include the shared component.

For example, suppose you have an InstallShield project that includes two features: "Chalets" and "Lebanon". If you want to share a file between these features, you can create a shared component and add it to both features. Any file included in the shared component will be accessible to both features, so you could include a file named "ChaletsForRent.txt" that contains information about chalets for rent in Beirut, Lebanon.

So, to sum up, by creating a shared component and adding it to multiple features in your InstallShield project, you can share files between those features. For example, you can share a file containing information about chalets for rent in Beirut Lebanon between the "Chalets" and "Lebanon" features.

0 Kudos