Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net framework 4.0 application run from USB drive

Tags:

c#

.net-4.0

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.

like image 448
Thomas Clayson Avatar asked Nov 21 '11 10:11

Thomas Clayson


1 Answers

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

like image 86
Wojtek Turowicz Avatar answered Nov 10 '22 11:11

Wojtek Turowicz