How to make an app - Andromo App Maker

Announcement

Collapse
No announcement yet.

How can I implement downloadable features/merge modules

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I implement downloadable features/merge modules

    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?

  • #2
    Simon, do you need to deploy this via MSI package, or could you implement this using a scripted installer? Your company has a license for Setup Factory, which would make such a project much easier to implement.

    Ulrich

    Comment


    • #3
      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:

      Click image for larger version

Name:	SCRN-2017-10-10-01.png
Views:	1
Size:	17.7 KB
ID:	298462

      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:

      Click image for larger version

Name:	SCRN-2017-10-10-02.png
Views:	1
Size:	13.6 KB
ID:	298463

      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:

      Click image for larger version

Name:	SCRN-2017-10-10-03.png
Views:	1
Size:	26.8 KB
ID:	298464

      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:

      Click image for larger version

Name:	SCRN-2017-10-10-04.png
Views:	1
Size:	25.1 KB
ID:	298465

      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:

      Click image for larger version

Name:	SCRN-2017-10-10-05.png
Views:	1
Size:	5.2 KB
ID:	298466

      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.

      Click image for larger version

Name:	SCRN-2017-10-10-06.png
Views:	1
Size:	7.7 KB
ID:	298467

      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


      • #4
        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


        • #5
          Hello Simon, I describe in my post everything that needs to be done in the script, but please understand that this is as far as I go here. I am happy to offer my consulting services beyond this point, and if you are interested, you can contact me at my site.

          Ulrich

          Comment

          Working...
          X