Our installer has become far too big (1.2 gig) and we need to reduce it in size. Our users generally only need to install 1 or maybe 2 of the features that come with our application and so it is pointless to have every feature in our installer. What I want to do is to have an installer where the user selects which features they want and then it downloads and installs only those features but I cant figure out how to accomplish this because it seems that the features and merge modules have to exist on my local disk before I can add them in MSI factory. I have put the features in to merge modules and I have figured out how to use lua script to download them but how do I get these items to appear in the features list before they are downloaded so that the user can select them and how do I install the merge modules at run time?
Announcement
Collapse
No announcement yet.
How can I implement downloadable features/merge modules
Collapse
X
-
After a few hours of tinkering, I have managed to get this working. Here is what you need to do:
1) Create a project with a "Feature Tree" install type, so you get the feature selection screen:
2) Go to Project - Media, and add as many items as you will have downloadable modules. In my sample, I have a set of "Base" files, and two optional features, so I added two additional cabinet files, which are not embedded into the MSI. Make sure that you assign a "disk name" text for each media:
3) Now go to Project - Features, and organize your files into the features. Files which should be installed always I assigned to "Base", while two larger files were assigned to the optional features:
4) Now, in the MSI Factory IDE, go to View - Column Manager, and make sure that you display the Media column. Place it somewhere convenient.
5) Finally, assign each file to the appropriate container. If it is part of the base package, use Media 1. The file for one optional feature goes to Media 2, while the file of the other optional feature is stored in Media 3. In my test, I used only a few files to check if my methodology works, of course you probably will have more than a single file per feature - this changes nothing.
Here is how the files are shown in the IDE:
6) Compile the project now. You should get the main MSI file, and a set of *.cab files, with the names as you set in step 2. I have these three files:
Now, the *.cab files can be transferred to your web server, from where the MSI will download them as needed.
As you may imagine, to perform the download, you will need to add some custom script. I created a LuaScript Custom Action, which I scheduled to be executed "Before InstallFinalize". This is right before the deployment of the files will happen, so just in time before we get an error message.
In this Lua script, you will need to fetch the contents of the SOURCEDIR Propery (so you know where the files need to be downloaded to), and the ADDLOCAL Property (so you can check which features were selected for install, and you can start the corresponding *.cab file download). You should also check if the *.cab file already exists, perhaps as the result of a previous download, to not download it again without the need. While downloading, you can display a StatusDlg, showing the progress, so the user can see that something is happening.
You can see a short video of this demo project I build for this, here: Screencast
The demo shows that the folder is initially empty (just the *.msi), then one *.cab is downloaded. On the next iteration, the other *.cab is downloaded, while the existing file is used and not downloaded again. This should be pretty clear to follow, but should you have additional questions, please let me know.
Ulrich
Comment
-
-
Hi Ulrich, Unfortunately I do need an MSI installer because our software is used quite often in places like colleges and universities where the network admins like to be able to roll out installations over the network. This looks very promising though! Thank you very much.
One last thing, is there any chance that I could get a copy of your lua script?
Comment
-
-
Comment