Link to home
Start Free TrialLog in
Avatar of najh
najhFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Creating MSI / installer files dynamically

I have a product I want to distribute on a website.  I have made an MSI installer, which seems to work fine.  One of the files in the package is a text file which works as a "key" to the product, and passes information specific to the owner of the product, and a key which is specific to the user of the product.  The product is written in Flash, and reads in the key to check that the product is licenced.  What I feel unsure about doing is distributing the package - i.e. how to do it.  

So what I want to know is, how do I go about having an installer which will install something slightly different for each user (based on their account details when they log into the site).  Is it possible to make a custom MSI installer sort of "on the fly" on a website? (and if so, what do i need to know or do, or where do i need to look to learn more?)  If the question doesn't quite make sense I'll happily clarify any bits...  

I'm using ASP.net (with C#)  and SQL Server.
ASKER CERTIFIED SOLUTION
Avatar of gtworek
gtworek
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vadim Rapp
Another way is to write a custom action that during the installation would reach out to your website and fetch the information.

With on-the-fly building the package, you would have to first create your text file, then build the package, including re-packing all the files. While it's certainly possible, such solution wouldn't be very stable.

Maybe an easier way would be this: during the download, your site generates a code; can be on the webpage, or sent in some confirmation email. Then the user will enter that code during the installation, and it will generate the needed file.

Alternatively, and probably even better, the user can enter that code already in the application. This allows for extending the license easily when necessary, by sending new key. During the installation, you can generate some "static" license for some short time, until the code arrives. This is how it's implemented in numerous products.

Avatar of najh

ASKER

I think the site generating the code for the user to type in won't work for me because there's an awful lot of customised information that'll need to go in to this file.
Is the on-the-fly building of bespoke installation packages with WIX known to be particularly unstable?
I know no issues with WiX. If your XML file works ok then changing some portions of data and recompiling it should be really easy.
Compiling may take some time so you should test it in your environment and maybe provide some "please wait" or similar webpage.
> I think the site generating the code for the user to type in won't work for me because there's an awful > lot of customised information that'll need to go in to this file.

Then you can generate that file and give the user to download. It's very close to what you want to do, only not tied to the installation, so you can give new file without new installation. The only downside is that the user will have to place to file in the right location. How example, that's how Winrar licensing works, and many others.
Avatar of najh

ASKER

That's exactly what I'm trying to avoid.  I want the user to download one installer with everything in.   I don't want them to have to download their main program, and then have to download another thing to make it work properly.  That would be terrible!!
What happens one year later, when their license has expired, and you issue new one? with your way, you have to create another installation, and have the user to reinstall - totally unnecessary.

What happens if you release new version before the license has expired? you will have to calculate the remaining time of the current license. Complex.

If you want to give your product for free trial, and then the user decides to order, with your way he will have to re-download and re-install. This will be quite uneasy because it will be the same version, so it will refuse to install the same one without uninstalling the first one.

Same if your product has different sets of features depending on the type of license and price. If the user orders "premium" version, with my way, you give new file, and it unlocks the features. With yours, re-download and reinstallation, during which taking care not to lose the settings and any data files.

Even if all this does not apply to your product yet, maybe in the future it will.

Of course I don't know any specifics of your product and it's you who decide what you really need, but if you look how lots of products are being licensed by downloading the key file, I bet you'll find much more examples of my scheme than yours.
vadimrapp1: do you know what MSI is and what it can do?
All your scenarios can be easily resolved with simple MSI files. It's way better than ordering users to "copy something somewhere".
> do you know what MSI is and what it can do?

1. I guess I do, kinda. Feel free to check out my profile on EE.

2. That's how I know that none of them are easily resolved by MSI files. For example, replacing key file in the same version of installed product would require building a patch, which is not what most people will call simple. And so forth.

3. asker's thread is not the best place for inter-experts' discussions. Moderator can set up private area by your request.
I know it's normal developer practice and I hate it. If you write _good_ app you never should leave maintenance at the user side. If it's too hard to create complete solution without requiring maintenance at file/registry/ini side - developer should never publish such app.
Big kudos for najh for making some effort to write good app and please let him make world simpler for users and not for programmers as you suggest.
Nothing prevents "good app" from auto-updating itself, including updating its own license.
Avatar of najh

ASKER

I appreciate your ideas and concerns - it's nice to think through alternatives.  And I had considered the separate licence file idea a little while back, but I didn't want to go for it because the environment I'm putting this app into is one where internet access is often very limited and so providing a single installer which could then be passed around a closed network would work better, and also the users I have in mind are very likely to generally not be internet savy.  I had considered licence renewals and the like too, but there are other parts of the product which would also age, so I thought a new installation of a new version app would be a nicer approach.  The other problem is that these decisions about the approach to go for are not mine alone - I'm not a "one man band" making apps for a couple of customers, but there are several other decision makers who would love the idea of a nice little installer which "does everything" and would shudder at the thought of dealing with additional key files. (unless they also had an installer, perhaps, but then we're back to the same problem of making a dynamic installation package)
I won't close the question yet as I'm still trying to get my head around WiX while doing a whole load of other little bits, and i'd be interested to hear from other developers who may be viewing the question (but not commenting) in case there are other alternative ways of making bespoke installation packages.
Avatar of najh

ASKER

Wix is an excellent tool choice.