我用 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模板网!
我可以在不编写 SQL 查询的情况下找出数据库列表Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不编写 SQL 查询的情况下
如何通过注册表搜索知道SQL Server的版本和版本How to know the version and edition of SQL Server through registry search(如何通过注册表搜索知道SQL Server的版本和版本)
为什么会出现“数据类型转换错误"?使用 ExWhy do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(为什么会出现“数据类型转换错误?使用 ExecuteNonQuery()?)
如何将 DataGridView 中的图像显示到 PictureBox?How to show an image from a DataGridView to a PictureBox?(如何将 DataGridView 中的图像显示到 PictureBox?)
WinForms 应用程序设计——将文档从 SQL Server 移动WinForms application design - moving documents from SQL Server to file storage(WinForms 应用程序设计——将文档从 SQL Server 移动到文件存
适用于 Windows XP 的 SQL Server 2012 Management StudioSQL Server 2012 Management Studio for Windows XP(适用于 Windows XP 的 SQL Server 2012 Management Studio)