必要时从 USB 驱动器安装 .NET framework [英] Installing .NET framework from USB drive when necessary

查看:41
本文介绍了必要时从 USB 驱动器安装 .NET framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个将通过 USB 驱动器分发的 .NET 应用程序.最终用户将连接驱动器并双击 EXE(.NET exe)以运行它,而无需安装它.

We have a .NET application that will be distributed through USB drive. End users will connect the drive and double click on the EXE (a .NET exe) to run it WITHOUT installing it.

现在的问题是,如果没有安装 .NET,我们希望触发 .NET 安装程序,而不是显示 MS 放置在那里的默认下载消息.安装程序将通过 USB 随应用程序一起分发.

Now the problem is, if .NET is not installed we would like to trigger the .NET installer instead of showing the default download message that MS has put there. The installer will be distributed with the application through the USB.

一种方法可能是替换 .NET 可执行文件中的 PE 存根文件.但是我没有在 C# 编译器中看到和/STUB 开关(尽管 C 编译器有它).

One way to do it might be by replacing the PE stub file in the .NET executable. But I am not seeing and /STUB switch in C# compiler (though C compilers had it).

还有什么其他人能想到的吗?

Anything else anyone can think of?

更新:感谢 Tim Robinson,我了解到 Windows 不处理 PE 存根文件.因此 ClickOnce 解决方案似乎是唯一可行的解​​决方案.我将检查 ClickOnce.

Update: Thanks to Tim Robinson, I understand that Windows doesn't process the PE stub file. Therefore the ClickOnce solution seems the only viable one left. I shall be checking ClickOnce.

推荐答案

为什么不使用 ClickOnce,它会为您完成所有这些.

Why not use ClickOnce, and it will do all that for you.

这篇关于必要时从 USB 驱动器安装 .NET framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆