Results 1 to 9 of 9

Thread: Odd error on executing exe file if dot not is not installed on computer.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2010
    Posts
    254

    Odd error on executing exe file if dot not is not installed on computer.

    Hi there,

    I installed my application on client computer designed in vb.net 2013 using dot net framework 4.5.1. Unfortunately I forgot to install framework on client computer, when i run exe file it displays odd error messages. What i want is when user executes my exe file and if dotnet framework is not installed it should provide a friendly message that "please install dotnet framework 4.5.1 to execute this program" and quits program.

    Please help me out

    Thanks
    Ladak

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,121

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Shouldn't that be handled by the installation, not the running of the program?
    Perhaps you didn't install the file on the computer, but copied it there?
    How can you have a program that can't run, display a friendly message saying it can't run?
    Last edited by passel; Dec 5th, 2014 at 05:13 AM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2010
    Posts
    254

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Hi passel, Thanks for your reply,

    I created setup with "Setup.Factory.9.3.2.0" and there is no such option to check dot net framework. There are other options to check windows operating system but no option to check framework that is why i tried to handle it while user clicks on exe file to check framework is installed or not.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,467

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Besides what passel says, i.e. any program that isn't running can't tell you that it isn't running, there something else to consider. When you build a .NET project, it gets compiled into IL code, not machine code. When you run the application, the .NET JIT compiler will convert that IL code into machine code on the fly. If there's no .NET Framework then that can't happen. If there's no machine code then there's nothing for the machine to run. The only machine code in the EXE is a header that tells the system to pass it on to the .NET Framework to do the rest. If there's no Framework then nothing happens.

    Basically, as passel says, if you want to ensure that the .NET Framework is always installed then you should build an installer for your app and include the Framework as a prerequisite. The easiest way to do that is to publish your project. That will create a ClickOnce installer and the Framework will be included automatically. By default, it will be downloaded on demand and only for those users who don't already have it installed. If you intend to distribute on physical media, you can change that to physically include the Framework. If you don't want to use ClickOnce then other installation tools will also allow you to include the Framework with varying levels of simplicity.

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,467

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Quote Originally Posted by accmaster View Post
    Hi passel, Thanks for your reply,

    I created setup with "Setup.Factory.9.3.2.0" and there is no such option to check dot net framework. There are other options to check windows operating system but no option to check framework that is why i tried to handle it while user clicks on exe file to check framework is installed or not.
    You can't so you're out of luck. The fact that your installation tool doesn't do it automatically doesn't mean that you can do it magically. I'm quite sure that there is a way to include prerequisites using that tool. It may be cumbersome but it will exists. Find out how to do it and then do it for the Framework. For instance, Inno doesn't do it automatically either but someone has provided an example of how to do it manually in our own CodeBank. I just took about 20 seconds on the web to find this:

    http://www.indigorose.com/forums/thr...Framework-2.0?

    Maybe not exactly what you need for your version but an obvious indication that it is quite possible to do it.

  6. #6
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,121

    Re: Odd error on executing exe file if dot not is not installed on computer.

    I guess if you setup a launcher targeting a framework that is probably going to be installed by default with the operating system, like 2.0 or 3.0, and have it check to see if the needed framework is there before it kicks off your executable, that might be one way to provide a friendly notice, but I don't know how to do that off the top of my head.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2010
    Posts
    254

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Hi jmcilhinney, thanks for your reply,

    I think its better to add 4.5.1 framework in my setup file if there is no option to check framework on executing exe file.
    The only thing is the size of setup will go very high. Rest is fine......

    Ladak

  8. #8
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,623

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Code:
    I created setup with "Setup.Factory.9.3.2.0"
    Any reason why you wouldn't just use the Visual Studio Setup project?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  9. #9
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,467

    Re: Odd error on executing exe file if dot not is not installed on computer.

    Quote Originally Posted by accmaster View Post
    Hi jmcilhinney, thanks for your reply,

    I think its better to add 4.5.1 framework in my setup file if there is no option to check framework on executing exe file.
    The only thing is the size of setup will go very high. Rest is fine......

    Ladak
    One thing I've seen in other installers is to simply popup a message telling the user that they must install the .NET Framework if they don't already have it and provide a link, leaving it up to them. If you want to make it as automatic as possible then it would seem that a dependency module, like the one provided in the link I posted, is the best way to go about it with that tool.

    The ClickOnce and Windows Installer tools included in VS do something similar with prerequisite packages. There are some packages provided by default and you can create your own as needed. You then simply check the prerequisites you want to include and the tool does the rest, i.e. checks whether it's already present during installation and downloads and installs as required. VS is .NET-centric so it includes the .NET Framework by default but that's no surprise.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width