0
votes

I've a WiX Setup for my C# application.

I have a WiX Bootstrapper used to install application, .NET framework and SQL Server.

I have 2 problems with the installation for SQL server.

  • On a PC with the application installed, my bootstrapper don't detect it and try to re install. On log file I see

"Registry key not found. Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL'"

But I checked with regedit, I got the register :

enter image description here

There is my code :

<util:RegistrySearch
    Id="SqlInstanceKeyFound"
    Root="HKLM"
    Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
    Value="SQLEXPRESS"
    Result="exists"
    Variable="SQLServerInstalled" />
  • On a PC without the application, the installation failed with error 0x84b40000.

There is my code :

  <ExePackage Id="SQLExpressx64"
              SourceFile=".\Resources\SQLEXPR_x64_ENU.exe"
              PerMachine="yes"
              Cache="no"
              Compressed="no"
              DownloadUrl="https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe"
              Permanent="yes"
              Vital="yes"
              InstallCommand="/q /hideconsole /action=Install /features=SQL /instancename=SQLEXPRESS /enableranu=1 /sqlsvcaccount=&quot;NT Authority\Network Service&quot; /AddCurrentUserAsSqlAdmin /IAcceptSqlServerLicenseTerms /skiprules=RebootRequiredCheck"
              InstallCondition="VersionNT64 AND NOT SQLServerInstalled" />

Thank you for help

1
I made a test : run the setup and say "NO" to accord administrator rights. Then I opened log file. Error "Registry key not found." is present. Maybe I should check the register with admin rights ? How can I do ?A.Pissicat
Win64="yes" in your registry search.Brian Sutherland
It works thank you ! Now I just have to achieve SQL Server install on PC without itA.Pissicat

1 Answers

0
votes

I'm not an expert, however, I worked on this.

My code was (working):

<util:RegistrySearch 
   Id="regsearchSqlInstanceFound" 
   Root="HKLM" 
   Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" 
   Value="$(var.SqlInstanceName)" 
   Result="exists" 
   Variable="SqlInstanceFound"
/>

My value variable was :

<?define SqlInstanceName=MSSQLSERVER?>