无法使用 wix 工具集创建 postgresql 数据库 [英] Can't create postgresql database with wix toolset
问题描述
我正在尝试使用 Wix 工具集在 PostgreSQL 中创建一个数据库,但我总是收到错误错误 -2147467259:无法创建 SQL 数据库:pontow,错误详细信息:未知错误."当我尝试创建数据库或错误无法连接到 SQL 数据库.(-2147467259 pontow)"时,当我简单地尝试对现有数据库执行 a 时.我做了一些研究,似乎是访问被拒绝,但无法使其正常工作.
I'm trying to create a database in PostgreSQL using Wix ToolSet, but I'm always getting the error "Error -2147467259: failed to create SQL database: pontow, error detail: unknown error." when I try to create a database or the error "Failed to connect to SQL database. (-2147467259 pontow )" when I simple try to execute a to a existing database. I made some research and it seems to be something with access denied, but can't get it working.
我已经试过了:
- 更改 'postgresql.conf' 并设置 'listen_address = '*'';
- 更改pg_hba.conf"并添加host all all 0.0.0.0/0 trust"这一行;
- PostgreSQL v9.6 和 v11.2;
- 授予所有人"对 PosgreSQL 文件夹和子文件夹的完全权限;
- 使用 Wix 'sql:SqlDatabase' SQL 身份验证和 Windows 身份验证;
我使用的是 Windows 10 x64,Wix 工具集 v3.11.
I'm using Windows 10 x64, Wix ToolSet v3.11.
我的 Product.wsx 文件:
My Product.wsx file:
<Binary Id="CreateTable" SourceFile=".\CreateTable.sql"/>
<Property Id="SQLUSERNAME" Secure="yes">postgres</Property>
<Property Id="SQLPASSWORD" Secure="yes">test</Property>
<Property Id="SQLSERVER" Secure="yes">localhost</Property>
<Property Id="SQLSERVERPORT" Secure="yes">5432</Property>
<Property Id="DATABASE_NAME" Secure="yes">pontow</Property>
<util:User Id="SQLUser" Name="[SQLUSERNAME]" Password="[SQLPASSWORD]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='InstallDir' Name='Test'>
<Component Id="SqlComponent" Guid="35e0e97e-cdce-428b-b553-d82fadf56b28" KeyPath="yes">
<sql:SqlDatabase Id="SqlDatabase" Database="[DATABASE_NAME]" User="SQLUser"
Server="[SQLSERVER],[SQLSERVERPORT]" CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="no">
<sql:SqlScript Id="CreateTable" BinaryKey="CreateTable" ContinueOnError="no" ExecuteOnInstall="yes"/>
</sql:SqlDatabase>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='SqlFeature' Title='SqlFeature' Level='1'>
<ComponentRef Id='SqlComponent' />
</Feature>
我希望使用 Wix 工具集创建一个 PosgreSQL 数据库,或者任何从 Setup.exe 创建数据库的建议将不胜感激.
I expect to create a PosgreSQL database using Wix Toolset or any suggestions to create a database from the Setup.exe would be appreciated.
推荐答案
WixSqlExtension
仅支持 SQL Server,不支持 PostgreSQL.
WixSqlExtension
supports SQL Server only, not PostgreSQL.
这篇关于无法使用 wix 工具集创建 postgresql 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!