6
votes

I need to put my C# application onto a usb drive. It needs to be executable from there.

The problem is that it requires .net framework 4.0 to run (or possibly 3.5 - it uses OpenXML to open, modify and save .docx word documents, I'm not sure if its compatible with 3.5).

Having the program on the USB drive means there won't be an installer, which in turn means that I can't build in the prerequisites check that normally says "You need .net framework 4.0... install now?".

Is there any way I can build a check in to the application prior to the default error message from Microsoft and install .Net framework 4.0 from an installer on the USB drive (see: Where I can download the REAL Full .Net Framework 4 Standalone Installer? for links to .net frameworks installers).

I realise this question is a duplicate of Installing .NET framework from USB drive when necessary however, I don't really understand the question and on looking up ClickOnce Deployment I'm not sure how that can help me at all.

Thank you.

1
That looks very interesting, and very useful, and potentially very apt for what I'm trying to do, however its quite complicated, and I'm not entirely sure I understand completely the processes involved. Is there potentially an idiots guide? Or does it rely on having an indepth knowledge of the processes and terms referenced?Thomas Clayson

1 Answers

2
votes

You can have a script in autorun that will check if there is a valid .NET and install it and then it'll run the app

vbscript to check if .net 2.0 is installed