0

Background : Customers have been copying a set of binaries and putting it on a specific location for them to run NinjaTrader Indicators. For Eg: lets assume The customer "A" has used First.dll, second.dll and Customer "B" has used First.dll and Third.dll (they did not use any installers, but just copied from a server location)

Current Requirement: I have to create a WIX installer with all possible updated DLLs with a caveat that it should install only those updated dll whose previous version customer has already on his machine. So if the new WIX installer has First_1000.dll, Second_1000.dll, Third_1000.dll and Fourth_1000.dll, then it should behave on Customer "A" and "B" as follows:

Customer "A": Uses this installer, his machine should have only First_1000.dll and Second_1000.dll and not others.

Customer "B": Uses this installer, his machine should have only First_1000.dll and Third_1000.dll and not others.

What I have Tried: Using the directorySearch and FileSearch, but I am not able to conditionally install, either it installs all or installs none. Other issue with this is it wont remove the previous version of the binary.

What I need: How to call a CustomAction method and use the return result to make decision to install or not, with this I can remove the previous version of the file as well.

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • Is this a technical must (due to security, licensing, size, etc...), or a "nice-to-have" feature requested by a manager who do not understand the technical challenges involved? What you describe is not rocket science, but still a whole lot of complexity to handle and bug-fix for seemingly very little gain? You can trust this to be accurate: nobody will be impressed with advanced deployment, but you will get a lot of trouble if you mess it up. Can requirements be simplified? – Stein Åsmul Jun 13 '18 at 10:18
  • Not a Must any other idea is also welcome, I chose wix expecting it to have some inbuilt functionality to leverage but looks like not a whole lot. Can I do everything from CA just using the wix to bundle the binaries? – Subhash Badri Jun 13 '18 at 10:50

2 Answers2

2

Overall advice: don't approach deployment as a development task first and foremost. Get your files and settings deployed, and do any advanced configuration on application launch.

Do not implement any custom logic if all you need is a file copy and some registry keys - and certainly don't do it all in one custom action using WiX / MSI as a "shell" or "container" only.

There are many tools that can help you deploy your software: How to create windows installer (also lists legacy tools that are not MSI tools).

At one point I wrote this step-by-step answer for a WiX installer.


If you ask me for the easiest way to achieve what you want, then I would install all files via a single MSI and use the application itself to adjust any access to advanced features (if applicable) via the license code (if any). This minimizes your deployment complexity, and puts advanced features in a familiar context: application debugging in user context (most likely).

This avoids a world of pain of custom setup logic - which is very heavily overcomplicated by sequencing, impersonation and conditioningconcerns, not to mention runtime dependencies and other challenges. Collectively this causes the overall problem that setup logic is very hard to debug - due to the collective impact of all these aspects of complexity.

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
0

The general approach that should work is to:

  1. Group the components (that contain one file each) into Features that when installed will do the right thing for each customer.

  2. Use Feature conditions based on the results of the file searches and the property values set from the searches.

This example in the WiX docs, Conditional Installation seems to do almost exactly what you're looking for.

In the longer term you should build a setup that doesn't require this type of search behavior. You don't say why the file names change, but I'll guess that you are using the different names as a kind of version control. Installs, patches, service packs, upgrades and so on all replace files based on their binary versions. In a well-designed application and install, the binary versions of the existing files might all be 1.0. If the new files are all versioned 1.1 then all the old files will be replaced. If one was version 1.0 (and therefore unchanged) it would not be replaced. The file names would not change. Version control is the basis for updates, so I recommend moving in that direction.

PhilDW
  • 19,260
  • 1
  • 14
  • 23