Wix Toolset: Create SQL Login

I'm working on an installer based on wix 3.9 which deploys a database along with other needed files. The installer must also add a Login to the SQL Server with sysadmin rights.

I have followed this thread with this code but I think that a local user is being created and definitely not an Login on my sql instance and unfortunately due to permissions I can't even access the CP to check for that. Any ideas would be helpful since I can't find any documentation on the issue.

<util:Group Name ="Benutzer" Domain="[ComputerName]" /> <Component Id ="CreateUserAccount" Guid="AEE91491-99FA-40A9-AB47-1E9FC2DDEF2A" Directory="TARGETDIR">
<util:User Id ="SQLUser" Name="[DBUSER_PROP]" Password="[DBPW_PROP]" UpdateIfExists="no" CreateUser="yes" PasswordNeverExpires="yes" PasswordExpired="no" RemoveOnUninstall="no"> <util:GroupRef Id ="Users" />
</util:User>

2 Answers

User creates Windows users. If you want to create a SQL login, use SqlString or SqlScript to run a CREATE LOGIN query.

0

Turned out easier than I thought

<sql:SqlString ExecuteOnInstall="yes" SQL="CREATE LOGIN SQL_USER WITH PASSWORD = 'password', DEFAULT_DATABASE=&quot;master&quot; , CHECK_POLICY= OFF;" Sequence="6"/>​

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like