问题
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.
回答1:
Create two entries in [Files]:
- one with
regserverflag to process whenIntegrateToExporertask is selected - one without the
regserverflag to process whenIntegrateToExporertask 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.
来源:https://stackoverflow.com/questions/29003187/register-explorer-com-extension-only-if-specific-task-was-selected