Inno Setup卸载程序VersionInfo

时间:2017-11-20 17:37:42

标签: inno-setup

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

Google和帮助对这个问题一无所知。我调查了Inno安装源,发现只为安装文件附加了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吗?

谢谢!

2 个答案:

答案 0 :(得分:1)

Inno Setup不支持此功能。

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

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

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

答案 1 :(得分:0)

不幸的是,接受的解决方案不起作用,因为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文件的版本信息。