Can't create postgresql database with wix toolset

妖精的绣舞 提交于 2020-01-30 03:29:22

问题


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.

I've already tried:

  • Change 'postgresql.conf' and set 'listen_address = '*'';
  • Change 'pg_hba.conf' and add the line 'host all all 0.0.0.0/0 trust';
  • PostgreSQL v9.6 and v11.2;
  • Give full permissions to "Everyone" to the PosgreSQL folder and subfolders;
  • Use Wix 'sql:SqlDatabase' SQL Authentication and Windows Authentication;

I'm using Windows 10 x64, Wix ToolSet v3.11.

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>

I expect to create a PosgreSQL database using Wix Toolset or any suggestions to create a database from the Setup.exe would be appreciated.


回答1:


WixSqlExtension supports SQL Server only, not PostgreSQL.



来源:https://stackoverflow.com/questions/55763634/cant-create-postgresql-database-with-wix-toolset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!