Installing .NET framework from USB drive when necessary

北城余情 提交于 2019-12-13 03:49:56

问题


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.

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.

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?

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.


回答1:


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




回答2:


You may want to check out this Episode of Hanselminutes

http://www.hanselman.com/blog/HanselminutesPodcast138PaintNETWithRickBrewster.aspx

He talks with the creator of Paint.NET who ends up doing some pretty creative things with the installer.



来源:https://stackoverflow.com/questions/852550/installing-net-framework-from-usb-drive-when-necessary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!