evan
evan

Reputation: 43

Wix SQL Server Install - localized names for NT AUTHORITY\NETWORK SERVICE and BUILTIN\Administrators

Attempting to create a SQL bootstrapper bundle that could potentially be installed on a non-English PC. Because of this I believe I need to be able to refer to the NT AUTHORITY\NETWORK SERVICE and BUILTIN\Administrators accounts in their localized names on the machine.

 <Fragment>
    <PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS"/>
    <PropertyRef Id="WIX_ACCOUNT_NETWORKSERVICE"/>

    <PackageGroup Id="SQLSERVER">
      <ExePackage Id="Sql2019Express"
                 DisplayName="SQL Server 2019 Express"
                 Cache="yes"
                 Compressed="yes"
                 PerMachine="yes"
                 Permanent="no"
                 Vital="yes"
                 Name="SQLEXPR_x64_ENU.exe"
                 SourceFile="Resources\SQLEXPR_x64_ENU.exe"
                 InstallCommand="/ACTION=Install 
                                 /INSTANCENAME=$(var.InstanceName) 
                                 /FEATURES=SQL 
                                 /SECURITYMODE=SQL 
                                 /SAPWD=[SqlVariable] 
                                 /TCPENABLED=1 
                                 /SQLSVCACCOUNT=&quot;[WIX_ACCOUNT_NETWORKSERVICE]&quot;
                                 /SQLSVCSTARTUPTYPE=Automatic 
                                 /SQLSYSADMINACCOUNTS=[WIX_ACCOUNT_ADMINISTRATORS]
                                 /ADDCURRENTUSERASSQLADMIN=FALSE 
                                 /Q 
                                 /IAcceptSQLServerLicenseTerms"
                 UninstallCommand="/Action=Uninstall /INSTANCENAME=$(var.InstanceName) /FEATURES=SQL /Q ">

        <ExitCode Value ="3010" Behavior="forceReboot" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

The install fails and when I look at the log I see that SQLSVCACCOUNT and SQLSYSADMINACCOUNTS are blank.

C:\ProgramData\Package Cache\004A55528A3D38224B71C2DE0D1A3291DAEF5E0F\SQLEXPR_x64_ENU.exe, arguments: '"C:\ProgramData\Package Cache\004A55528A3D38224B71C2DE0D1A3291DAEF5E0F\SQLEXPR_x64_ENU.exe" /ACTION=Install /INSTANCENAME=***** /FEATURES=SQL /SECURITYMODE=SQL /SAPWD=***** /TCPENABLED=1 /SQLSVCACCOUNT="" /SQLSVCSTARTUPTYPE=Automatic /SQLSYSADMINACCOUNTS= /ADDCURRENTUSERASSQLADMIN=FALSE /Q /IAcceptSQLServerLicenseTerms'

Obviously there's something I'm missing to link back to WIX_ACCOUNT_ADMINISTRATORS and WIX_ACCOUNT_NETWORKSERVICE and grab those values. Any help is most appreciated.

Upvotes: 1

Views: 285

Answers (2)

Sean Hall
Sean Hall

Reputation: 7878

The correct answer to why it's not working was given on the mailing list - PropertyRef is only for MSI, it does nothing in bundles. v4 would have given a warning here.

Because of this I believe I need to be able to refer to the NT AUTHORITY\NETWORK SERVICE and BUILTIN\Administrators accounts in their localized names on the machine

According to this forum post, you don't have to deal with localizing the English names. English names have been supported in those parameters to the installer regardless of the OS language since SQL Server 2008.

Upvotes: 1

TomTom
TomTom

Reputation: 62157

Because of this I believe I need to be able to refer to the NT AUTHORITY\NETWORK SERVICE and BUILTIN\Administrators accounts in their localized names on the machine.

No, you do not. What you do need is look up their SID's - the numeric form that is the same on all machines.

https://learn.microsoft.com/en-us/windows/security/identity-protection/access-control/security-identifiers

As you use WIX, there seems to be a WixQueryOsWellKnownSID somewhere - not used that for years - helping to get a known SID.

You do NOT use the names - as you said, those do not work internationally. And this is why MS publishes lists of well known SID's.

Upvotes: 1

Related Questions