I need to install these some DLL files to the GAC.
I use preprocessor to generate [Files]
section entries for these DLLs. And I need to provide a value for the StrongAssemblyName
parameter.
So question
- Can I automatically retrieve the
StrongAssemblyName
of a DLL from a Pascal Script? - If not, can one create a dictionary so I could look up in the dictionary using the assembly name as key, and then have hardcoded value strings that would get used when automatically building up the line
Source: path; DestDir
I would prefer the first solution, if possible.
I do not think, there's a native way to retrieve a strong name in Inno Setup Pascal Script.
But, you can use a simple PowerShell command to retrieve the strong name.
Combining these two questions:
you get a code like:
Though actually, you cannot use Pascal Scripting, as you need the strong name on compile-time, and the Pascal Scripting is executed on install-time only. In some cases, you can use a scripted constant, but it's not supported in the
StrongAssemblyName
parameter.So again, you have to use a preprocessor.
The Pascal Script code translates to the preprocessor like:
You can use it in the
StrongAssemblyName
parameter like:Which gets preprocessed to something like:
Though, as you generate the
[Files]
section completely by a preprocessor, your current code from your comment will now work, as the syntax, that you have used, actually callsGetAssemblyStrongName
preprocessor macro and notGetAssemblyStrongName
Pascal Script function.Note that the macro above uses C-style strings, so it has to be outside the Pascal-style
pragma
directives: