【问题标题】:Using GetStringFileInfo in Setup section of Inno Setup在 Inno Setup 的 Setup 部分使用 GetStringFileInfo
【发布时间】:2018-03-19 10:53:20
【问题描述】:

引用GetStringFileInfo post 后,我尝试阅读程序集信息并将AppNameFileVersion 应用到Inno Setup 脚本,如下所示。

但编译后的安装向导只显示"GetStringFileInfo("{#RootDirectory}Sample.exe","Title")" 作为软件标题。 GetStringFileInfo 根本没有处理。怎样才能让它正常运行?

#define RootDirectory "bin\Release\"

[Setup]
AppName=GetStringFileInfo("{#RootDirectory}Sample.exe","Title")
AppVersion=GetStringFileInfo("{#RootDirectory}Sample.exe","FileVersion")

请注意,我使用的是 Script Studio,该文件位于由 Inno 安装向导创建的 setup.iss

【问题讨论】:

    标签: inno-setup


    【解决方案1】:

    这是一种基于 Inno Setup 提供的 example 的替代方法。他们的代码显示:

    #define AppVersion GetFileVersion(AddBackslash(SourcePath) + "MyProg.exe")
    
    [Setup]
    AppVersion={#AppVersion}
    VersionInfoVersion={#AppVersion}
    

    我已经删除了示例的其余部分。请注意,对GetFileVersion 的调用是在[Setup] 部分之外完成的。另一个答案在[Setup] 部分有更直接的方法。

    【讨论】:

    • 我不知道这种方法。如果它在示例文件中会很好。我要把你的答案加到我的上面吗?或者只是删除我的?
    • 现在好点了吗?随意调整。
    【解决方案2】:

    GetStringFileInfo 是一个预处理器函数。 inline call of a preprocessor function 的语法是:

    AppName={#GetStringFileInfo(RootDirectory + "Sample.exe", "Title")}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-16
      • 1970-01-01
      • 2016-05-17
      • 1970-01-01
      • 1970-01-01
      • 2014-05-06
      • 2013-03-27
      相关资源
      最近更新 更多