无法使用wix工具集创建postgresql数据库
Can't create postgresql database with wix toolset
我正在尝试使用 Wix ToolSet 在 PostgreSQL 中创建数据库,但是当我尝试创建数据库时总是收到错误 "Error -2147467259: failed to create SQL database: pontow, error detail: unknown error." 或错误 "Failed to connect to SQL database. (-2147467259 pontow )" 当我简单地尝试对现有数据库执行 a 时。我做了一些研究,它似乎是访问被拒绝的东西,但无法让它工作。
我已经试过了:
- 更改'postgresql.conf'并设置'listen_address = '*'';
- 更改 'pg_hba.conf' 并添加行 'host all all 0.0.0.0/0 trust';
- PostgreSQL v9.6 和 v11.2;
- 授予 "Everyone" 对 PosgreSQL 文件夹和子文件夹的完全权限;
- 使用 Wix 'sql:SqlDatabase' SQL 身份验证和 Windows 身份验证;
我正在使用 Windows 10 x64,Wix ToolSet v3.11。
我的 Product.wsx 文件:
<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 创建数据库的建议都将不胜感激。
WixSqlExtension
仅支持 SQL 服务器,不支持 PostgreSQL。
我正在尝试使用 Wix ToolSet 在 PostgreSQL 中创建数据库,但是当我尝试创建数据库时总是收到错误 "Error -2147467259: failed to create SQL database: pontow, error detail: unknown error." 或错误 "Failed to connect to SQL database. (-2147467259 pontow )" 当我简单地尝试对现有数据库执行 a 时。我做了一些研究,它似乎是访问被拒绝的东西,但无法让它工作。
我已经试过了:
- 更改'postgresql.conf'并设置'listen_address = '*'';
- 更改 'pg_hba.conf' 并添加行 'host all all 0.0.0.0/0 trust';
- PostgreSQL v9.6 和 v11.2;
- 授予 "Everyone" 对 PosgreSQL 文件夹和子文件夹的完全权限;
- 使用 Wix 'sql:SqlDatabase' SQL 身份验证和 Windows 身份验证;
我正在使用 Windows 10 x64,Wix ToolSet v3.11。
我的 Product.wsx 文件:
<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 创建数据库的建议都将不胜感激。
WixSqlExtension
仅支持 SQL 服务器,不支持 PostgreSQL。