Dot-Net

我可以在 Inno Setup 中讀取 AssemblyFile 資訊嗎

  • September 23, 2020

我想從我的 Inno Setup 腳本中的 application.exe 中讀取這三個值。

[assembly: AssemblyCompany("My Company")]
[assembly: AssemblyProduct("My Great Application")]
[assembly: AssemblyFileVersion("9.3.2")]

有誰知道這可能是如何實現的?

我知道我可以使用GetFileVersion(“path/to/greatapp.exe”)獲得最後一個 ,前兩個有類似的東西嗎?

使用GetStringFileInfo()Inno Setup Preprocessor (ISPP) 提供的函式如下:

  1. GetStringFileInfo("path/to/greatapp.exe", "CompanyName")
  2. GetStringFileInfo("path/to/greatapp.exe", "ProductName")
  3. GetStringFileInfo("path/to/greatapp.exe", "FileVersion")

正如您已經提到的,您可以使用該GetFileVersion()函式而不是上面的#3。

另外,ISPPBuiltins.iss請查看 Inno Setup 安裝中包含的腳本文件。它包含一個GetFileCompany()函式來代替上面的#1,你可以用類似的方式實現上面的#2。

引用自:https://stackoverflow.com/questions/1433106