2012-10-31 51 views
0

我想用我的WiX安裝程序部署PostGreSqlServer,但它只是不斷失敗,我不知道爲什麼。用WiX安裝程序安裝PostGreSql

我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 

是否有任何維克斯大師在那裏? :)

+2

請勿將此類安裝程序與通用應用程序分發。計算機的用戶可能已經安裝了PostgreSQL,在這種情況下,安裝將失敗。或者他們以後可能會這樣做,並且會想知道爲什麼他們找不到任何指示 - 因爲您的程序使用自己的超級用戶帳戶和密碼安裝了PostgreSQL。通常最好使用.zip二進制文件,然後使用initdb並自己創建服務帳戶。 –

回答

2

您可以使用WIX v3.6 Bundle概念來處理此問題。您可以在這裏閱讀更多關於它的信息http://wix.sourceforge.net/manual-wix3/authoring_bundle_intro.htm

基本上,您將WIX MSI和EXE打包到一個WIX捆綁包中,然後可以將其安裝到目標機器上。

或者您可以編寫可以通過CustomActions執行的腳本,例如您嘗試的EXECCommand。但我寧願使用Bundle,因爲它以更好的方式管理卸載和升級。所以試試WIX包,看看它是如何發展的。

1

這個不起作用的最可能的原因是postgres exe文件已經包含msi,並且您只能在創建一個事務時安裝一個msi,並且(目前我已經聽說過計劃改變這種情況),您可以一次只能運行一個事務。正如前面的答案所述,您可以使用刻錄包將兩個安裝程序打包在一起,形成無縫的用戶體驗。你也可以通過執行註冊表搜索來檢查你是否確實需要安裝postgres。

0

只要Windows用戶訪問控制被關閉,我已經成功地使用了您正在使用的技術。