This started life as a discussion here and it boils down to the following [Run]
entries:
Filename: "{dotnet40}\regasm.exe"; \
Parameters: "PTSTools_x86.dll /codebase"; \
WorkingDir: "{app}"; \
Flags: runhidden
Filename: "{dotnet4064}\regasm.exe"; \
Parameters: "PTSTools_x64.dll /codebase"; \
WorkingDir: "{app}"; \
Flags: runhidden; \
Check: IsWin64
As documented here about Constants it states:
{dotnet40}
...
An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 4.0 or later present.
And it says similar for {dotnet4064}
:
An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 4.0 or later present.
Now, the statement is a little misleading because I looked under the hood at the Inno Setup code, and if the InstallRoot
registry key is missing it will raise an exception (Internal Error). This itself does not mean the Framework is not installed. But this is a side issue.
What is the most elegant way for us to cater for this requirement to use try
/catch
so that we don't get this cryptic popup? I actually had a user who had this happen and it was because he did not have the InstallRoot
key.