wix 可以提示输入 Windows 服务用户名/密码吗?

发布于 2024-10-24 21:04:32 字数 83 浏览 1 评论 0原文

我正在使用 Wix 安装 Windows 服务。该服务需要在用户设置的非系统/服务帐户下运行。

是否可以提示输入服务登录的用户名/密码?

I am using Wix to install a windows service. The service will need to run under a non system/service account that is set up by the user.

Is it possible to have it prompt for the username/password for the service login?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

一个人的旅程 2024-10-31 21:04:32

GitHub 上的社区 MSI 扩展包含一个用于提示用户名和密码的 ServiceCredDlg 对话框。根据文档,它可以测试凭据是否有效以及该用户拥有“作为服务登录”的权限。

The Community MSI Extensions on GitHub contains a ServiceCredDlg dialog for prompting username and password. According to the docs, it can test the credentials are valid and that user has 'logon as a service' rights.

七颜 2024-10-31 21:04:32

是的,但它不是内置的。您可以在 WiX 中设置一个 GUI(这不是太直观),您可以在其中提示您在后续步骤中需要的任何设置。

首先,按照 创建一个设置自定义属性的 GUI这些指南,确保您的 GUI 填充属性 SERVICEACCOUNT 和 SERVICEPASSWORD。然后将 ServiceInstall 元素与这些属性结合使用,如此处所示。

Yes, but it's not built-in. You can setup a GUI in WiX (which is not too intuitive) where you can prompt for any setting you'll need in later steps.

First, check out how to create a GUI that sets custom properties by following these guidelines, ensuring that your GUI fills properties SERVICEACCOUNT and SERVICEPASSWORD. Then use the ServiceInstall element with those properties as shown here.

缺⑴份安定 2024-10-31 21:04:32

WiX 没有(或者至少没有)提供任何开箱即用的功能来满足您的需求。据我所知,最好的选择是自己动手。

https://www.geekproject.com/post/wix-service-account -对话框/

WiX doesn't (or at least didn't) have anything nice out of the box for what you are looking for. Best option that I am aware of is to roll-your-own.

https://www.geekproject.com/post/wix-service-account-dialog/

作妖 2024-10-31 21:04:32

您可以在命令行上使用凭据设置 PUBLIC PROPERTIES(大写)并使用它们来安装服务。

msiexec.exe /I "setup.msi" /QN USER="username" PASS="password"

还可以使用自定义操作从用户处检索这些值在交互式安装期间,但如果执行此操作,请记住使消息的显示遵循设置的 UILevel 值。在静默安装中显示来自自定义操作的消息框被视为严重的安装错误:

  • INSTALLUILEVEL_NONE 2 完全静默安装。
  • INSTALLUILEVEL_BASIC 3 简单的进度和错误处理。
  • INSTALLUILEVEL_REDUCED 4 编写的 UI,禁止向导对话框。
  • INSTALLUILEVEL_FULL 5 编写带有向导、进度、错误的 UI。

也许最好的选择是在交互式安装中显示对话框,如果未在命令行上设置这些属性,则拒绝静默安装。这是一个简单的自定义操作,用于测试 USER 和 PASS 属性的值。

并且显然不建议使用用户帐户来运行服务。

You can set PUBLIC PROPERTIES (uppercase) with the credentials on the command line and use these to install the service.

msiexec.exe /I "setup.msi" /QN USER="username" PASS="password"

A custom action can also be used to retrieve these values from the user during an interactive install, but if you do this remember to make the display of the message obey the setups UILevel value. Showing a message box from a custom action in a silent install is considered a serious setup error:

  • INSTALLUILEVEL_NONE 2 Completely silent installation.
  • INSTALLUILEVEL_BASIC 3 Simple progress and error handling.
  • INSTALLUILEVEL_REDUCED 4 Authored UI, wizard dialogs suppressed.
  • INSTALLUILEVEL_FULL 5 Authored UI with wizards, progress, errors.

Perhaps the best option is to show the dialog in an interactive install, and refuse to install silently if these properties aren't set on the command line. This is a simple custom action to test the values of the USER and PASS properties.

And obviously it is not recommended to use user accounts to run services.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文