cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
markhug
Level 4

Display a finished message at end of Silent Install - Pure InstallScript project type

Hi,
InstallShield 2015 Premier - Pure Installscript project type.
I want to run the installer in silent mode.
I recorded a response file "setup.iss" and then ran it successfully for the silent install.

So far so good.

Now i want to display a message box/Finish dialog to the user to notify installation is complete even in silent install (yes I realize that it sounds like it is defeating the purpose of a silent install).
I tried changing the response file directly and I also tried a condition with MODE = SILENTMODE check at the end (to trigger the SdFinish dialog) but nothing seems to work.
I suppose I could write a small wrapper install application but this seems like a lot of over-head for what should be very simple.

Note that it does NOT need to be an official SdFinish dialog. A simple MessageBox with IFX_SDFINISH_MSG1 in it would be more than adequate.

Does anyone have a good solution / workaround that would suit my needs?

Thanks for any help anyone can provide,
Mark
Labels (1)
0 Kudos
3 Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

All the built in InstallScript dialogs contain code to handle silent mode by reading any responses from a response file. Either building your own dialog code based off of the SdFinish code (without the response file handling) or overriding SdFinish in your project with the response file handling removed should accomplish what you're looking for. You can look at the SdFinish code by selecting Dialog Source from the event category combo box in the InstallScript view, then select SdFinish from the event function list combo box.

One thing to take note of, though, is that displaying any UI from an installation run silently (with '/s') breaks the expectation that the installation will run silently and not require any interaction. If this setup is ever deployed through something like SCCM, any dialogs that are displayed could prevent the setup from exiting unless something on the machine kills the setup process (which won't be great since there are still some cleanup tasks in the InstallScript engine that run after the last dialog closes).
0 Kudos
markhug
Level 4

Hello Josh and thanks for your reply.
I misunderstood your post initially.

I have exposed the SdFinish and remmed out the SILENTMODE handling.
That worked great, thanks.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Calling the InstallScript MessageBox function won't work as you are expecting in silent mode because the MessageBox function checks if the installer is running in silent mode and reads from a response file then skips displaying the message box. All built in InstallScript dialog functions will include this behavior. If you want to display a message box in a silent install, your script will need to make a direct call to the Win32 MessageBoxW API.

If you want to call SdFinish (or any other Sd dialog) and have it display while running silently, you will need to include the dialog code in your script and remove the following block of code from it:

if(MODE=SILENTMODE) then
SdMakeName( szAppKey, szDlg, szTitle, nSdFinish );
SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
if((nId != BACK) && (nId != CANCEL)) then
SilentReadData( szAppKey, "bOpt1", DATA_NUMBER, szTemp, bOpt1 );
SilentReadData( szAppKey, "bOpt2", DATA_NUMBER, szTemp, bOpt2 );
endif;
return nId;
endif;


Notice that this code checks if the dialog is called in silent mode, then reads response file data, and finally returns without calling DefineDialog or EzDefineDialog to display the dialog. If this code is not removed, the dialog will not display in silent mode. Alternately, you can write your own dialog function to load a dialog and process its message loop.
0 Kudos