Results 1 to 11 of 11

Thread: [RESOLVED] [Inno Setup] Check if Net Framework 2.0 is installed

  1. #1

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Resolved [RESOLVED] [Inno Setup] Check if Net Framework 2.0 is installed

    Hi!!

    How can i check if Net Framework 2.0 is intalled

    Thks
    Last edited by Lasering; Apr 20th, 2007 at 03:41 PM.
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    Doesn't the .NET framework check to see if it is already installed when it attempts to install?

  3. #3

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    I dont know couse i have already the net framework installed on all my computers.
    But does the Inno Setup does that by default?
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    Inno has nothing to do with the .NET framework, so it doesn't check for it.

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    So, why don't you attempt to re-install the .NET framework to see if it checks if it is already installed???

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

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    Something else to do is to do what I have started doing lately.

    1. download and install Microsoft Virtual PC 2007 (FREE)
    2. install an OS on it (requires you have a liscense for that OS that not already being used)
    3. install all Windows updates
    4. defrag and compact the install
    5. mark the virtual hard drive as readonly
    6. create a differencing hard drive based main one you just created
    7. install and test what ever you want, only the differencing disk will change
    8. repeat steps 6 and 7 as needed

    I know this doesn't answer your immediate issue, but may be useful, and it's a good way to test your installations and applications in various systems as if you were installing it on a users PC.

    I've provided a link to the artiale that describes using Virtual PC and differencing disks.

    CT

  7. #7

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    Thks a lot Cavar, but i dont have 2 licenses, i just have my windows.

    How can i do a If in Inno Setup like:

    If Registrykeythattellsmeifnetisinstalled=true then
    continue installer
    else
    Msgbox("Pls visit http://... to install net framework"
    end if

    The key i go find to see which is it.
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  8. #8
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    You can write code for that in Inno Setup.

  9. #9

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    that i already knew! Thks anyway!!!

    But how can i do the part continue? And how can i do for this code to be processed before anything?

    EDIT: I found how to do part of it
    VB Code:
    1. [Code]
    2. function InitializeSetup(): Boolean;
    3. begin
    4. If {reg:HKLM\Software\Microsoft\NET Framework Setup\NDP\v2.0.50727,Install} := 0 then 'in here i dont know how to do this correctly
    5. MsgBox('The setup detected that .Net Framework 2.0 is not installed in your system.' #13#13 'Please install it. You can download it from http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en', mbInformation, mb_Ok);
    6. Result := False
    7. end;

    now i just need to know how to make a clickable link the msgbox and how to the the if line, if u know what i mean.
    Last edited by Lasering; Apr 23rd, 2007 at 02:11 PM.
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  10. #10
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    You can ask Klienma. He does Inno Code. He hangs out in the VB .NET forums.

  11. #11
    New Member
    Join Date
    Apr 2007
    Posts
    1

    Re: [Inno Setup] Check if Net Framework 2.0 is installed

    Hi,
    just dropped by since I was searching for a way to check if windows media player is installed on a win2k system within inno ...
    if anyone knows please let me know...

    Anyway here is some code to check for .net 2.0... and send the user to ms to download .net if not available on the system...

    Code:
    [CustomMessages]
    en.dotnetmissing=This setup requires the .NET Framework v2.0. Please download and install the .NET Framework v.2 and run this setup again. Do you want to download the framework now?
    
    de.dotnetmissing=Dieses Programm benötigt Microsoft .NET Framework v2.0. Bitte downloaden und installieren Sie Microsoft .NET Framework v2.0 und führen Sie anschliessend die Installation erneut aus. Wollen Sie das Framework jetzt downloaden?
    Code:
    function InitializeSetup(): Boolean;
    var
        ErrorCode: Integer;
        NetFrameWorkInstalled : Boolean;
        Result1 : Boolean;
    begin
    
    	NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
    	if NetFrameWorkInstalled =true then
    	begin
    		Result := true;
    	end;
    
    	if NetFrameWorkInstalled = false then
    	begin
    		NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
    		if NetFrameWorkInstalled =true then
    		begin
    			Result := true;
    		end;
    
    		if NetFrameWorkInstalled =false then
    			begin
    				//Result1 := (ExpandConstant('{cm:dotnetmissing}'), mbConfirmation, MB_YESNO) = idYes;
    				Result1 := MsgBox(ExpandConstant('{cm:dotnetmissing}'),
    						mbConfirmation, MB_YESNO) = idYes;
    				if Result1 =false then
    				begin
    					Result:=false;
    				end
    				else
    				begin
    					Result:=false;
    					ShellExec('open',
    					'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe',
    					'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
                    end;
                end;
    	end;
    end;

    cheers

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