Results 1 to 5 of 5

Thread: Inno setup dotnet version detect

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    165

    Inno setup dotnet version detect

    I have the following line in an instal file:

    success := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727', 'Install', install);

    Clearly this is not going to detect any later versions that may have been installed on XP or 2000 but I can't seem to find any good example of less specific code or any good explanations of these RegQuery functions and the fields, eg what exactly is the difference between a key and a subkey?

    They appear only to check or return keys specified in full. What I really need surely is to search for any keys containing "NET Framework Setup\NDP\v", read the entire value and then check the version number but can't figure out how to do that.

    Grateful for any ideas.

  2. #2
    Addicted Member
    Join Date
    Dec 2005
    Posts
    139

    Re: Inno setup dotnet version detect

    Why do you need to check for newer versions? If your application is written using .NET Framework 2.0, then you should check for that entry, not Framework 3.0 or 3.5.

    If you really need to determine all .NET Framework versions installed, then I think you need to check for them one by one. You may be able to do this via a loop, but I imagine a function that checks each version and exists and returns the latest would be best.

    You can check out this article to see how they determine the .NET Framework version installed. I think they used to use "dotnetchk.exe", but changed it in a later version.

    C

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    165

    Re: Inno setup dotnet version detect

    Thanks very much for reply. But surely if a later version has been installed with an application then that will work with mine, so I am popping up another box unecessarily. Or perhaps I am misunderstanding how it works.

    Worse, my instal may fail. With the code given, my instal will pop up another box telling the user to instal 2.0, the dotnet instal will then detect the newer version properly, give a message to that effect and close. There is no way for my install to tell if dotnet 2 correctly detected a new version and it is safe to proceed or just failed to instal for some reason.

  4. #4
    Addicted Member
    Join Date
    Dec 2005
    Posts
    139

    Re: Inno setup dotnet version detect

    Quote Originally Posted by xoggoth View Post
    Thanks very much for reply. But surely if a later version has been installed with an application then that will work with mine, so I am popping up another box unecessarily. Or perhaps I am misunderstanding how it works.

    Worse, my instal may fail. With the code given, my instal will pop up another box telling the user to instal 2.0, the dotnet instal will then detect the newer version properly, give a message to that effect and close. There is no way for my install to tell if dotnet 2 correctly detected a new version and it is safe to proceed or just failed to instal for some reason.
    My understanding was that if an app was written againt .NET 2.0, then you need that framwork installed and .NET 3.5 won't work, so there's not reason to check for the latest, but I may be wrong since I haven't tried that and someone may be able to correct me.

    If your program uses .NET 2.0 I would check for it specifically, not 3.5. If it's there then I would prompt the user to download it or you can just package it in your install.

    I believe that the ShellExec process in Inno Setup will return a result that you can check. So if you shell out to the .NET framework setup you should get a result back telling you if installation worked or not. You will need to look in the help file or go to the Inno Setup site for more info.

    Or, you could just check for .NET 2.0 in your setup and if you don't find it, then inform the user they need to download and install it, then exit your setup. Once they have installed the frameowrk, then they can re-run your setup.

    Hope this helps,
    C

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    165

    Re: Inno setup dotnet version detect

    Cheers, maybe I am making wrong assumptions here. Might put 3.5 on the spare laptop and try it.

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