WinForms 需要框架、自定义消息吗?
我有一个基于 WinForms 构建的产品安装程序,它不是一个安装程序项目,因为它需要执行很多特定的操作,例如安装其他程序、运行 python 脚本、解压缩文件等。
所以问题是这个安装程序需要框架 4,但是当找不到框架,用户会收到一条过于通用的消息,类似于“发生意外错误。”,所以我想知道是否有任何方法可以修改此消息,或者其他一些解决方法。
我显然不想为我的安装程序分发安装程序,因为这也太违反直觉了......
I have a product installer built on WinForms, it's not an installer project because it needs to do lots of specific things, like installing other programs, running python scripts, decompressing files, etc.
So the problem is this installer requires framework 4, but when framework is not found, the user gets a way too generic message along the lines of "An unexpected error occurred.", so I was wondering if there was any way to modify this message, or some other work-around for this.
I obviously don't want to distribute an installer for my installer, because that would be so counter-intuitive too...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该将 .Net 框架与您的应用程序一起分发。
除了使用引导程序之外,您还可以尝试使用 IExpress 等工具或其他自解压工具包。
您可以设置自解压文件来运行 .Net Framework 安装程序,如果您想要精简版安装,您还可以找到在线安装程序,并将其作为运行主安装的安装后步骤。如果安装了 .Net 框架,第一个安装程序不应安装任何其他
可用于创建自解压文件的免费工具: 7-Zip。
You should distribute .Net framework with your application.
Beside using a bootsrapper you could try using a tool like IExpress or another self extracting toolkit.
You could set the self extracting file to run the .Net Framework installer, you can also find the online installer if you want a lite install, and as a post install step to run your main installation. If the .Net framework is installed the first installer should not install anything
Other free tool that you can use to create a self extracting file would be 7-Zip.
如果您只关心捕获此异常并使其成为另一个不那么通用的异常,您可能会对 企业库异常处理应用程序块。
If your concerne is only to trap this exception and make it another one less generic or so, you might be interested in the Enterprise Library Exception Handling Application Block.
您是否考虑过安装先决条件,即引导?
Have you considered installing the prerequisites i.e bootstrapping?