Archive: Request MUI example with multiple install directories for 'family' of apps


Request MUI example with multiple install directories for 'family' of apps
I've seen a number of posts about using multiple installation directories. It hasn't jelled in my mind, and I think a "best practices" example using the Modern-UI would be VERY helpful.

I've looked at MUI InstallOptions.nsi and think I can maybe figure out something, but that would perhaps be reinventing the wheel, and the MUI author (or other expert) would seem the best person to provide something like a template to clone from.

The application I'm working on is part of a "family" of freeware apps. Each app would be in its own directory and use something like a FAMILY_PATH registry variable or environment variable to find resources that are used in common "family wide" by multiple applications.

I want to allow the end-user to provide the installation directory for that specific executable, and a separate resource path. The default might be something like:

C:\Program Files
C:\Program Files\Family
C:\Program Files\Family\Resources
C:\Program Files\Family\BasicApp

Another person might use a simiar nsis script to install
C:\Program Files\Family\AdvancedApp
It could detect that Family\Resources were already installed and proceed accordingly.

Each application might be available "bare bones" or with a "StarterKit" with a basic resource. The apps aren't usable until there is at least one resource installed (there are hundreds of resources). A concern is having redundant resources with the directory structure ending up like:

C:\Program Files\BasicApp\Resources
C:\Program Files\AdvancedApp\Resources

A great example might handle reading and possibly writing the actual FAMILY_PATH environment variable with something like:
WriteEnvStr.nsh
(perhaps using a separate component page?)

The uninstall would seem to be tricky ... to detect if another "family application" is installed and use that information to control whether the resources could/should be removed.

Does something like this already exist? I've seen previous examples, but my impression is that many are obsolete with nsis version 2.0 and the MUI.

Such an example would be greatly appreciated.


okay im no expert but I think you should be able to just have the apps pull resources from */family path/resources/ and then when you install just have $instdir be */family path/ and install the resources needed for that program and just overwrite any ones that are already there.

I'm assuming that you want your dir tree to end up looking like this

*/family path/
*/family path/app1/
*/family path/app2/
*/family path/app3/
*/family path/resources/

where you dont want the user to be able to change the dir after family path.

The only problem might be over writing newer resources but im pretty sure that there is a way to check for that.


Almost ... there is an environment variable (something like FAMILY_PATH) that an associated but separate InstallManager.exe uses to download resources.

To be accepted to be part of this family of applications, a candidate app is required to use a FAMILY_API that has a C++ SwMgr object that sniffs around in the application path and then the FAMILY_PATH to detect which resources are available.

Part of my concern is that I'm a rather junior member of this aforementioned family of applications, and trying to help out with converting the current installer from InstallShield to NSIS.

Also, I'm about ready to submit a possibly controversial candidate app to the family, and want to minimize the potential for the installer causing problems for other apps that share the resources. (almost sounds like the mafia :-) My impression is that there is a lot that can go wrong in this scenario (especially uninstalls), and I'm not at all an expert with nsis.