問題描述
我用 WiX 3.8 制作了一個引導程序項目.作為安裝 SQL Server Express 2012 的先決條件,將SQLExpress"設置為新 SQL Server 實例的名稱.然后在 MSI 我想創建一個新的 SQL 用戶登錄.我用用戶元素試過這個,但它似乎不起作用.當我查看 SQL Server 管理工具中的登錄信息時,我看不到我的新用戶,但我的 MSI 日志告訴我,他是創建的.
I have made a bootstrapper-project with WiX 3.8. As a prerequisite SQL Server Express 2012 is installed, setting "SQLExpress" as name of the new SQL Server instance. Then in the MSI i want to create a new SQL user login. I tried this with the User-element, but it doesn't seem to work. When i take a look to the logins in the SQL Server Management tool, i can't see my new user, but the log from my MSI tells me, that he was created.
我的用戶元素版本有問題還是需要我換一種方式?
Is there something wrong with my version of the User-element or have i to take another way?
<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"
Domain="[ComputerName]">
</util:User>
</Component>
推薦答案
在 Windows-installer-xml-wix-toolset 的 Phill Hogland 的幫助下,我找到了解決方案.這取決于 PC 上使用的語言.在我的情況下,這是德語,這意味著無法通過名稱Users"找到用戶組,而是Benutzer".
With the help of Phill Hogland from Windows-installer-xml-wix-toolset i have found the solution. It depends on the language used on the PC. In my case that's german, which means, the group Users cannot be found by the name "Users" but "Benutzer".
這里是正確的代碼:
<util:Group Id="Users"
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>
</Component>
進一步您可以用包變量替換硬編碼的名稱.然后你將獨立于操作系統語言.
Further You can replace the hardcoded name by a bundle-variable. Then You will be independent from the OS language.
這篇關于如何創建對 SQL Server 實例的登錄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!