How to check & add Windows Feature, e.g. with "dism /online /add-capability"

35 views
Skip to first unread message

Oliver Heggelbacher

unread,
Oct 20, 2025, 9:47:26 AMOct 20
to innosetup
I need a setup that checks if Windows Feature VBSCRIPT is available and if not, add it, e.g. using:
dism /online /add-capability /capabilityname:VBSCRIPT

I searched docs & forum but I could not find any more recent post on this topic, but did not get any clear insights.

- Now Docklight Scripting, as the name indicates, makes use of the VBSCRIPT (5.6) engine that was part of Windows until recently. Microsoft even claimed it would be still "default enabled" until around 2027:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/vbscript-deprecation-timelines-and-next-steps/4148301
But turns out, a little change of heart there and already in fresh Win11 24H2 installation it's not:
https://docklight.de/dl_prb067/

I am hesitant about simply hacking in a Pascal Scripting Exec line like this old stackoverflow post suggests:
https://stackoverflow.com/questions/21986988/inno-setup-an-attempt-was-made-to-load-a-program-with-an-incorrect-format-wh

--> Any recommendation / experience on how to verify and add Windows Features in an interactive way? I.e. making the user aware this is lacking, but asking for explicit permission to add the missing feature?

Any feedback is highly appreciated.
Thanks,
Oliver

PS:
Like Innosetup, we have been around with Docklight for ages. I found out about Innosetup in 2003, donated in 2007, and of course I bought the official commercial license just now. I have rarely come across a piece of software that is maintained and kept up-to-date with such dedication and brilliant execution. So, thanks, Martijn Laan & Jordan Russell, for saving us and our customers from so many unnecessary headaches. 

Gavin Lambert

unread,
Oct 20, 2025, 5:59:02 PMOct 20
to innosetup
On Tuesday, October 21, 2025 at 2:47:26 AM UTC+13 Oliver Heggelbacher wrote:
I need a setup that checks if Windows Feature VBSCRIPT is available and if not, add it, e.g. using:
dism /online /add-capability /capabilityname:VBSCRIPT

dism can be used to query capabilities as well.  Having said that, on my 23H2 system that particular capability doesn't exist.

There are separate commands for features too, but I didn't find anything there either.  Likely you'd need to make it conditional on Windows version, or on the capability/feature existing.

If you prefer a programmatic approach, there is an API for DISM, which you could theoretically call direct from [Code], but it might be easier to make a helper DLL.

--> Any recommendation / experience on how to verify and add Windows Features in an interactive way? I.e. making the user aware this is lacking, but asking for explicit permission to add the missing feature?

You can show a messagebox or custom page in [Code] to alert the user of the issue and ask for permission to install it.

Martijn Laan

unread,
Oct 21, 2025, 2:07:10 AMOct 21
to innosetup
Hi Oliver,

Op 20-10-2025 om 15:43 schreef Oliver Heggelbacher:
Like Innosetup, we have been around with Docklight for ages. I found out about Innosetup in 2003, donated in 2007, and of course I bought the official commercial license just now. I have rarely come across a piece of software that is maintained and kept up-to-date with such dedication and brilliant execution. So, thanks, Martijn Laan & Jordan Russell, for saving us and our customers from so many unnecessary headaches. 

Thank you very much for your kind words and your purchase. It is greatly appreciated.

Greetings,
Martijn
Reply all
Reply to author
Forward
0 new messages