VS.NET MSI 安装程序屏幕自定义

发布于 2024-10-07 04:14:25 字数 315 浏览 0 评论 0原文

我已将两个文本框屏幕添加到我的 MSI 安装程序中,并有一个自定义安装程序操作,该操作可以挂钩回我正在安装的应用程序,以将配置设置保存到 app.config 文件中。

我的问题是这样的: 除了允许您将默认文本添加到 MSI 自定义文本框的 MSI 属性屏幕之外,是否有办法让 MSI 抓取值以将其从文件或 Web 服务或其他内容放入文本字​​段?我真的不希望将这些值硬编码到 MSI 属性屏幕中,并且必须重新编译和重新分发才能更改它们。

我真的很想将一个 XML 或 CSV 文件放入安装程序中,并让它从该文件中读取它们,但我还没有找到一种方法来做到这一点。

谢谢。

I've added two textbox screens to my MSI installer, and have a custom installer action that hooks back to the application I'm installing to save config settings to the app.config file.

My question is this:
Other than the MSI property screens that allow you to add default text to the MSI custom textboxes, is there a way to have the MSI grab values to put into the text fields from a file or web service, or something? I don't really want these values hard coded into the MSI property screens, and have to recompile and redistribute to change them.

I'd really like to just throw an XML, or CSV file in WITH the installer, and have it read them out of that file, but I haven't seen a way to do that.

Thank you.

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

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

发布评论

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

评论(2

青柠芒果 2024-10-14 04:14:26

通过使用本机代码 (C) 编写的自定义操作,您可以在安装程序中执行任何操作,只要执行 MSI 的用户有权执行此操作(这取决于是 UI 阶段还是 MSI 的执行阶段) MSI - 后者由系统服务运行)。

With a custom action written in native code (C), you can do anything you want in an installer, as long as the user executing the MSI has permission to do so (which depends on whether it's the UI phase or the execute phase of the MSI - the latter is run by a system service).

失退 2024-10-14 04:14:26

我最终要做的是使用 GetPrivateProfileString 导入“kernel32”dll,并将自定义编写的 INI 文件粘贴到 MSI 旁边。我试图填写的属性屏幕已被删除,现在我可以根据每个客户端的设置部署自定义 INI 文件,而无需重新编译,并对项目中的安装程序设置进行繁琐的更改。如果您希望我发布代码,请发送电子邮件或联系我。

What I eneded up doing was using GetPrivateProfileString from importing "kernel32" dll, and sticking a custom written INI file next to the MSI. The property screens I was trying to fill out were removed, and now I can deploy a custom INI file with settings on a per client basis, without having to recompile, and make tedious changes to the installer settings in the project. Email or contact me if you want me to post the code.

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