Q:

Register Explorer COM extension only if specific task was selected

I have a complicated program for working with documents. Client requirement: it should be conditionally integrated in Windows Explorer context menu during install, i.e. then user check the corresponding option.
So, in my Inno Setup script [Tasks] i've created a separate task named IntegrateToExporer.
And in the [Files] section - two COM DLL files (x86/x86-64 version) with regserver flag.
My question is: how to make regserver flag conditional?it must be applied only if user select IntegrateToExplorer task, otherwise file should be copied just like others.

A:

Create two entries in [Files]:

one with regserver flag to process when IntegrateToExporer task is selected
one without the regserver flag to process when IntegrateToExporer task is not selected

[Files]
Source: "my.dll"; DestDir: "{app}"; Flags: regserver; Tasks: IntegrateToExporer
Source: "my.dll"; DestDir: "{app}"; Tasks: not IntegrateToExporer

See Components and Tasks Parameters in Inno Setup documentation.

