Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Checking for .NET before running

Checking for .NET before running

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zlosk
    wrote on last edited by
    #1

    Is there any way to check that .NET is installed before running? I'm looking to have my program put up an error message stating that .NET needs to be installed if hasn't been yet, kind of like how Windows programs used to tell you that you need to run the program in Windows if you try to start them up in DOS. To not know is bad. To not wish to know is worse.

    D 1 Reply Last reply
    0
    • Z Zlosk

      Is there any way to check that .NET is installed before running? I'm looking to have my program put up an error message stating that .NET needs to be installed if hasn't been yet, kind of like how Windows programs used to tell you that you need to run the program in Windows if you try to start them up in DOS. To not know is bad. To not wish to know is worse.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your going to need some kind of external process to check for the existence of the .NET Framework BEFORE your VB.NET app is launched. This is because the .NET Framework is needed just to load the VB.NET app. I haven't been able to find any method of replacing the stub code in a .NET executable to put up the kind of message you want. But, I could be wrong... RageInTheMachine9532

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Your going to need some kind of external process to check for the existence of the .NET Framework BEFORE your VB.NET app is launched. This is because the .NET Framework is needed just to load the VB.NET app. I haven't been able to find any method of replacing the stub code in a .NET executable to put up the kind of message you want. But, I could be wrong... RageInTheMachine9532

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        DumpBin /imports indicates that the executable has a static reference to _CorExeMain in mscoree.dll. The loader won't load the executable if mscoree isn't present. So even if you could replace the stub, it wouldn't help.

        D 1 Reply Last reply
        0
        • M Mike Dimmick

          DumpBin /imports indicates that the executable has a static reference to _CorExeMain in mscoree.dll. The loader won't load the executable if mscoree isn't present. So even if you could replace the stub, it wouldn't help.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I was 99% sure it couldn't be done, just because of the reason you specified. :-D I was just looking for a second opinion. About the only way you could do that is to have a second executable check for the existence of the mscore.dll first, maybe with version checking too :), then launch the .NET EXE if it finds it. Thanks! RageInTheMachine9532

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            I was 99% sure it couldn't be done, just because of the reason you specified. :-D I was just looking for a second opinion. About the only way you could do that is to have a second executable check for the existence of the mscore.dll first, maybe with version checking too :), then launch the .NET EXE if it finds it. Thanks! RageInTheMachine9532

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            I have asked a great Delphi coder to code something that detects if the framework is installed. If it is, it launches my application, if not, it tells the user which version is required (1.0/1.1) and gives the option to install it (from the CD). Very efficient way of doing it. The good thing about it being done in Delphi is that it requires no external DLL or runtime (VB6 would require VBRUN6.DLL). It could also have been done in C++, but we felt Delphi was a better language for this purpose.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups