【问题标题】:Unattended install of AutoIt 3.3.6.1: need 32-bit version but can only get 64-bit versionAutoIt 3.3.6.1 无人值守安装:需要 32 位版本但只能获得 64 位版本
【发布时间】:2013-06-26 23:33:58
【问题描述】:

我想自动/无人值守地安装 AutoIt,然后能够从 Ruby 脚本驱动 AutoItX。

完成后,我应该能够运行这个基本代码并让它成功:

require 'win32ole'
WIN32OLE.new('AutoItX3.Control')

由于它似乎是 Nullsoft (NSIS) 安装程序,我可以使用 /S 标志强制进行安静安装。但是在我安装它并尝试上面的代码之后,它会产生这个错误:

WIN32OLERuntimeError: failed to create WIN32OLE object from `AutoItX3.Control'
    HRESULT error code:0x80040154
      Class not registered

似乎 AutoIt 的安装程序默认安装 64 位版本,因为我使用的是 64 位版本的 Windows 7。但我无法让 AutoIt 与 Ruby 一起使用,除非我安装 AutoIt 的 32 位版本(我相信这是因为 Ruby for Windows 仍然是 32 位的)。

有人知道在无人值守安装中强制使用 32 位版本的方法吗?

【问题讨论】:

  • 你不能只是分发 AutoItX 的副本并手动注册 dll 吗?
  • @Matt,您“手动注册 dll”的提示是我拼图中缺失的部分。谢谢。

标签: ruby windows 32bit-64bit nsis autoit


【解决方案1】:

只需使用 AutoIt 的 ZIP 版本。然后,您可以只使用AutoIt.exe 而不是AutoIt_x64.exe

如果需要,您可以使用 7za.exe 之类的解压缩实用程序将其打包,如 here 中所述。

【讨论】:

    【解决方案2】:

    事实证明,AutoIt 安装程序确实安装了必要的 32 位 DLL 以及 64 位库,但显然它没有正确注册。

    通过cd-ing 到安装根目录的AutoItX 子目录并运行以下命令:

    regsvr32 AutoItX3.dll
    

    ...我能够使它与 Ruby 的 WIN32OLE 库一起工作。

    【讨论】:

    • 您可能还想使用/s 开关静默注册它。
    猜你喜欢
    • 2021-07-08
    • 2012-04-18
    • 1970-01-01
    • 1970-01-01
    • 2020-10-28
    • 1970-01-01
    • 1970-01-01
    • 2014-11-19
    • 1970-01-01
    相关资源
    最近更新 更多