Inno Setup Preprocessor Tip for .NET Developers

I love ISPP because it really makes things easier. But .NET sometimes brings differences. For example,

#define MyAppVersion GetFileVersion("..\bin\release\Lextm.CodeBeautifierCollection.Framework.dll")

Because my assembly is .NET and I forget to set AssemblyFileVersion attribute in code, MyAppVersion is empty! How dangerous! That’s why GrapeVine M4 and M5 installers does not save version information into registry.

Generally speaking, for .NET assemblies, AssemblyVersion is more common. You just need to specify AssemblyFileVersion so as to make them similar to Win32 DLLs.

I’d like to make AssemblyVersion equal to AssemblyFileVersion. However, if you take a look at CodeGear RAD Studio assemblies, you may find something different.

© Lex Li. All rights reserved. The code included is licensed under CC BY 4.0 unless otherwise noted.

© - Lex Li. All rights reserved.

Using the Chirpy theme for Jekyll.

Last updated on May 01, 2024