【问题标题】:Inno Setup uninstaller VersionInfoInno Setup 卸载程序 VersionInfo
【发布时间】:2018-05-04 00:33:29
【问题描述】:

我为我的安装程序使用 Inno Setup。 unins000.exe 中的 VersionInfo 有问题。为了在安装程序中填充 VersionInfo,我使用了指令 AppPublisherAppCopyright 等。但它不影响安装程序卸载程序 unins000.exe

Google 和帮助对这个问题一无所知。我调查了 Inno Setup 源,发现仅为安装文件附加 VersionInfo:

        { Update version info }
        AddStatus(SCompilerStatusUpdatingVersionInfo);
        UpdateVersionInfo(ExeFile, VersionInfoVersion, VersionInfoProductVersion, VersionInfoCompany,
          VersionInfoDescription, VersionInfoTextVersion,
          VersionInfoCopyright, VersionInfoProductName, VersionInfoProductTextVersion);

        { For some reason, on Win95 the date/time of the EXE sometimes
          doesn't get updated after it's been written to so it has to
          manually set it. (I don't get it!!) }
        UpdateTimeStamp(ExeFile.Handle);
      finally
        ExeFile.Free;
      end;
    end;

    { Sign }
    if SignTools.Count > 0 then begin
      AddStatus(SCompilerStatusSigningSetup);
      Sign(ExeFileName);
    end;
  except
    EmptyOutputDir(False);
    raise;
  end;

但是我在卸载程序编译代码中找不到这个例程。

有人知道,可以把版本信息发给unins000.exe吗?

谢谢!

【问题讨论】:

    标签: inno-setup


    【解决方案1】:

    Inno Setup 不支持这个。

    您必须在编译时自己修改版本信息。

    Imo,在链接到安装程序之前访问卸载程序可执行文件的唯一方法是滥用SignTool“回调”。设置为SignTool 的命令实际上可以对可执行文件执行任何操作,而不仅仅是“签名”它。但无论如何它都必须“签名”它(Inno Setup 明确检查可执行文件是否在“工具”完成后签名)。

    您可以通过将SignTool 设置为最终运行实际signtool.exe 的批处理文件(或其他脚本)来实现,但在此之前,它将修改版本信息(例如使用Resource Hacker 命令-行)。

    【讨论】:

    • 伟大而简单的想法!谢谢!附言我已经从 github 源代码重新编译了 ISCmplr.dll。 dll编译成功,但不能正常工作((现在我去尝试使用批处理文件重写VersionInfo并签署卸载程序。再次感谢您)!
    • 这里有类似的问题没有答案:stackoverflow.com/questions/1885948/…你也可以回答这个问题,或者我可以复制粘贴你的答案吗?
    • @EugeneMala 感谢您指出这一点。我已将该问题标记为与此问题重复。
    • 好的,我明白了。我使用这种技术来change binary flags。那行得通。可能EXE文件头没有包含在测试中。
    【解决方案2】:

    不幸的是,接受的解决方案不起作用,因为SignTool“回调”不能以这种方式被滥用。深入研究 Inno Setup 源,我发现编译器在签署卸载可执行文件后使用following 验证:

      { Sanity check: Remove the signature (in memory) and verify that
        the signed file is identical byte-for-byte to the original }
    

    我找到了一个快速解决问题的方法。 Inno Setup 使用Setup.e32 文件作为uninst000.exe 的模板。

    由于 Inno Setup 是完全可移植的 - 您可以为每个需要在卸载程序中包含自定义版本信息的项目维护 Inno Setup 二进制文件夹的单独副本(默认为 %ProgramFiles%\Inno Setup 5\)。

    您必须在 Inno Setup 二进制文件的每个副本中修改 Setup.e32 文件的版本信息。

    【讨论】:

      猜你喜欢
      • 2016-01-14
      • 2016-05-28
      • 1970-01-01
      • 1970-01-01
      • 2021-06-29
      • 2015-10-19
      • 2011-10-01
      • 2011-09-18
      • 2016-09-27
      相关资源
      最近更新 更多