【问题标题】:Installing PostGreSql with WiX Installer使用 WiX 安装程序安装 PostGreSql
【发布时间】:2012-11-07 13:10:13
【问题描述】:

我正在尝试使用我的 WiX 安装程序部署 PostGreSqlServer,但它只是一直失败,我不知道为什么。

我的 wxs 文件的重要部分:

<Binary SourceFile="postgresql-9.2.1-1-windows.exe" Id="PostGreInstaller"  />

<CustomAction  Id="InstallPostGre" BinaryKey="PostGreInstaller"
               ExeCommand='"--serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended"'
               Execute="deferred" Return="check"   Impersonate="yes" />

<InstallExecuteSequence>
  <Custom Action="InstallPostGre" Before="InstallFinalize" />
</InstallExecuteSequence>

已经在 cmd shell 中尝试过该命令,并且成功了。不要为什么它不在安装程序中。

我确定安装程序已嵌入安装程序,因为它有超过 50MB。

我也开启了我的 msi 并开启了日志记录,但这也对我没有帮助...

Action 16:34:29: InstallPostGre. 
MSI (s) (64:E0) [16:34:29:407]: Executing op: CustomActionSchedule(Action=InstallPostGre,ActionType=1026,Source=BinaryData,Target=--serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended,)
MSI (s) (64:E0) [16:34:31:698]: Note: 1: 1721 2: InstallPostGre 3: C:\Windows\Installer\MSIE410.tmp 4: --serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended 
MSI (s) (64:E0) [16:34:31:698]: Note: 1: 2205 2:  3: Error 
MSI (s) (64:E0) [16:34:31:698]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1721 
Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: InstallPostGre, location: C:\Windows\Installer\MSIE410.tmp, command: --serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended 
MSI (s) (64:E0) [16:34:34:717]: Note: 1: 2205 2:  3: Error 
MSI (s) (64:E0) [16:34:34:717]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709 
MSI (s) (64:E0) [16:34:34:717]: Product: Hausverwaltung -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: InstallPostGre, location: C:\Windows\Installer\MSIE410.tmp, command: --serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended 

那里有 WiX 大师吗? :)

【问题讨论】:

  • 请不要将这样的安装程序与通用应用程序一起分发。计算机的用户可能已经安装了 PostgreSQL,在这种情况下安装将失败。或者他们将来可能想这样做,并且会想知道为什么他们找到的指令都不起作用 - 因为您的程序使用您自己的超级用户帐户和密码静默安装了 PostgreSQL。通常最好使用 .zip 二进制文件,然后使用 initdb 并自己创建服务帐户。
  • @raphi011 你能解决这个问题吗? :D

标签: postgresql installation wix embedded-resource


【解决方案1】:

这不起作用的最可能原因是 postgres exe 已经包含一个 msi,并且您在创建事务时一次只能安装一个 msi,并且(目前我听说计划更改此设置)您只能一次运行一项事务。正如前面的答案所述,您可以使用刻录包将两个安装程序打包在一起,从而获得无缝的用户体验。您还可以通过注册表搜索检查您是否真的需要安装 postgres。

【讨论】:

    【解决方案2】:

    您可以使用 WIX v3.6 Bundle 概念来处理此问题。你可以在这里阅读更多关于它的信息http://wix.sourceforge.net/manual-wix3/authoring_bundle_intro.htm

    基本上,您是将 WIX MSI 和 EXE 打包成一个 WIX 捆绑包,然后可以将其安装到目标机器上。

    或者您可以编写可以通过 CustomActions 执行的脚本,例如您尝试过的 EXECCommand。但我更愿意使用 Bundle,因为它以更好的方式管理卸载和升级。所以试试 WIX 捆绑包,看看效果如何。

    【讨论】:

      【解决方案3】:

      只要关闭 Windows 用户访问控制,我就成功使用了您使用的技术。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-11-10
        • 1970-01-01
        • 1970-01-01
        • 2019-12-13
        • 1970-01-01
        相关资源
        最近更新 更多