cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MiguelAlho
Level 3

Control progress bar in a Basic MSI installer

Jump to solution

I've been trying to work on the progress bar in a Basic MSI installer I have, but with no success. My installer is mainly composed of powershell based Custom Actions (no file copies from the main setup design). Unfortunately, non of my CAs actually affect the progress bar. 

I've gone through the docs and forum, but nothing I do seems to affect the progress bar in anyway.

I have setup a sample repo with a project to try to isolate and work on the behavior, at https://github.com/MiguelAlho/installshield.customaction.progress . This latest version is using lower level calls to MsiRecordSetInteger() but I had previously tried using SetStatusWindow() with no success, either.

I want each (at this point in time) for each CA to advance the progress bar a bit, but all I get is a blank progress most of the installer's work time. I've added a few MessageBox() calls to help debug what is going on.

Any help figuring this out is highly appreciated!

Labels (1)
0 Kudos
(1) Solution
bluespider
Level 3

Hi Miguel,

I have been trying to do something similar (also BasicMSI) but instead used a C++ MSI DLL rather than install script for the custom actions as I needed to call Win32 API functions.  My attempt at a solution has wasted me a lot of time as well but was also based on the same Microsoft article. That article lacks clarity and among other things doesn't explain that the progress bar subscription only works AFTER InstalFiles and as such it seems that a progress bar in a custom dialog PRIOR to this is doomed to failure (I suspect). My install needs progress bar and other custom dialogs before the actual installation starts and its not a simple install. Your example is straightforward and looks as though it should work but I think that we both have lost of unanswered questions here. Would be interested to know how you solved yours in the end. 

View solution in original post

0 Kudos

(6) Replies
banna_k
Revenera
Revenera

Hi @MiguelAlho :

 

Related KB article on adding custom actions progress to the progress bar.

https://community.flexera.com/t5/InstallShield-Knowledge-Base/Adding-a-Custom-Action-s-Progress-to-the-Progress-Bar/ta-p/3489

 

Did you tried the sample custom action code provided by the Microsoft to update the progress bar:

https://docs.microsoft.com/en-in/windows/win32/msi/adding-custom-actions-to-the-progressbar

 

If so, see whether your custom action code is getting executed during the installation. may be you can put a message box(or debug) and verify it  is getting executed.

0 Kudos

Hi @banna_k ,

 

Thanks for your quick reply. Yes I tried both - the first article suggests using a dll / VBscript - in this case I tried with Installscript as the functions that are described by the MS docs are available in the Installscript code. The code can be seen at the Setup.rul file in the repo (direct link: https://github.com/MiguelAlho/installshield.customaction.progress/blob/master/test2/Script%20Files/Setup.rul ). 

I added message boxes to know what is being executed at each moment (and they popup) and delays to give the UI time to update, but no change in the progress bar is visible.

0 Kudos
bluespider
Level 3

Hi Miguel,

I have been trying to do something similar (also BasicMSI) but instead used a C++ MSI DLL rather than install script for the custom actions as I needed to call Win32 API functions.  My attempt at a solution has wasted me a lot of time as well but was also based on the same Microsoft article. That article lacks clarity and among other things doesn't explain that the progress bar subscription only works AFTER InstalFiles and as such it seems that a progress bar in a custom dialog PRIOR to this is doomed to failure (I suspect). My install needs progress bar and other custom dialogs before the actual installation starts and its not a simple install. Your example is straightforward and looks as though it should work but I think that we both have lost of unanswered questions here. Would be interested to know how you solved yours in the end. 

0 Kudos

I haven't solved the problem, completely, yet (and probably never will). User experience  for us is very important in this specific installer, so we decided to give up on the InstallShield solution and build a custom installer. This specific installation is heavily based on custom actions, so we have moved it into application logic (c#) that we are much more comfortable working with.

So far, the experience has been simpler for us and the customization of the UI is styled to our own themes.

0 Kudos
madelen56
Level 2

progress bar is a dynamic, graphical bar that fills up in response to control events. When you select a progress bar control in a dialog of the Dialogs view, InstallShield displays the following settings in the right pane. Enter a name for this progress bar.

I've done a search but things are just not sinking in, so. ... I have tried the VBscript custom action and an install script version of it from the ... I still want to use the standard Basic MSI progress bar "as is" I just need to ... It's not a progress bar,

https://customersurveyinfo.com

0 Kudos

Right well this is a sorry state of affairs. It seems to me as though there are plenty more obstacles and pitfalls with writing an InstallShield Basic MSI installers. If you only need to write installers for simple hello world applications then everything is fine but it does explain why some other users give up and try and write their own from scratch in various other horrible ways. 

Side Rant... (the dialog editor events, move up, move down... RSI hall of shame on you who put this UI in place or just decided to leave it like that! if you can't support drag and drop then at least put up down arrows at the top of the table. NOT in a freaking popup menu! )

 

So My Findings...

1. Progress Bars are probably useless on anything other than the main SetupProgress dialog. Any custom action updating them has to run in deferred mode and so has to be scheduled in the Installation Execute Sequence and has to be scheduled after InstallInitialize. 

2. If you attempt use SpawnWaitDialog to indicate perform some lengthy action then if the action is run in Async mode it will STALL immediately at the moment it calls MsiProcessMessage to send a progress or other message to be handled by a subscription in the SpawnWaitDialog. So that doesn't work either. 

Oddly your custom action will resume and complete when you cancel the setup!!!

Perhaps you can just have a stupid SpawnWaitDialog dialog sit there and do nothing except set a property leaving the user wondering what the hell is going on. 

3. You can't make a SpawnWaitDialog look like a regular one and its position is offset. When you want to auto close it you can't auto advance the next button on the main. 

4. I have tried running my custom action in deferred mode BUT I need it to execute BEFORE feature prerequisites are installed and that seems impossible.

My Questions...

1. SO HOW THE HELL DOES THE INSTALLATION OF FEATURE PREREQUISITES UPDATE THE PROGRESS BAR?

2. Is it really impossible to schedule a deferred custom action before feature prerequisites are installed?

3. Where is it documented or discussed that MsiProcessMessage is going to hang up until InstallInitialize or setup is cancelled if you try call it from an async UI CA. Can anyone explain?

4. Could you use a sync CA and run a thread of your own. Will that MSI DLL remain loaded? Has anyone tried?

Its looking like time for a rethink on my design to find a way work around these unexpectedly horrible limitations. 

 

5. I suppose that since these limitation are at lease partly due to Dialog interaction issues that inserting my own custom user interface somewhere and somehow might be worth a passing thought. Has anyone tried this with success?

I really was hoping to make use of standard Dialog UI features and not have to add considerable size & complexity to my installer by mixing in additional UI from elsewhere.

 

 

0 Kudos