Click here to Skip to main content
Click here to Skip to main content

.NET Framework 1.1 Installer for Innosetup

By , 22 May 2004
 

Introduction

Here is an Innosetup script I wrote that installs the dotnet framework. It's pretty intuitive I think. I couldn't find any extensive ones when I was searching and working on it, so I thought I'd post it.

It detects if the following are installed, and then downloads from Microsoft (if they aren't in a root \dependencies folder already) and installs them for the user without prompting them. IE 6 prompts for a download location (this could be changed to a total quiet install, but there would be a long wait with no status updates).

  • NT4 sp6a - required by dotnet, when on nt4
  • IE 6 - required by dotnet
  • MDAC 2.8 - My app needed it
  • Jet 4.0 sp3 - dao 3.6 isn't included in mdac 2.7...
  • .NET 1.1

The setup does skip the application directory dialog if an exclusive reboot is needed (I disabled the app dir wizard page FYI, you'll want to re-enable that).

Those who are looking for alternative ways to install .net services might want to consider using things like InstallUtil and net start and net stop. The base functions, as well as some misc functions that I use personally, are also included in the script.

Thanks IS, ISX and ISXDL authors!

Here's a link to my original post: http://news.jrsoftware.org/news/innosetup.isx/msg06108.html

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Ted Ehrich
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
General.net framework 1.1 causes that when you start windows ask for administrator to log inmemberzionlion4 Sep '09 - 16:57 
Is there any solution to this? I want to install .net framework 1.1 but I am afraid as usual it messes up the windows start up. Can anyone help me please?
GeneralA more straight forward scriptmemberPriyank Bolia3 May '08 - 8:41 
I searched Google and found this page:
http://www.timesprite.com/BlogEntries/dotnet.iss
It looks much better to me, particularly, if you look at the: NextButtonClick function.
Thanks.
 

General.NET Framework 1.1/2.0/3.5 installer scriptmemberstfx13 Oct '07 - 23:20 
I extended your script with .net framework 1.1/2.0/3.5, windows installer 3.1, 2.0 and much more.
Just wanted to thank you and leave this link to my article.
QuestionAn offline installermemberMarco Tenuti21 Oct '06 - 19:47 
I just "discovered" InnoSetup, ISTool, and this very useful tool, that lets me deliver in half an hour a professional installer for a .NET application I developed in the last week.
I didn't try the installer at all, except that from my computer. My hardware is of course a development machine and it has everything installed of course, so this setup does none of course. I hope to have some poorly equipped machines in the next hours to make some deeper test.

What are the steps to make the same job, in case of a computer which is not connected to the internet or in the case it cannot access to the internet throught a large band connection? I would like to deliver an installation in a quick-and-dirty CD-ROM, that should include all the needed packages.
 
In such case:
 
1- I could save about the Download DLL dependency (although I would like to use also it, in order to detect some important information or last minute notes I could give from some page in my websites)
2- I should include the "downloaded" packages as quiet installation setup files
3- I would detach from an important weakness, i.e. the Microsoft bizarre change of package URLs. Such changes determine the failure of the some downloads and maybe the failure of the entire process (I'm not sure of that, because I need to make any test).
 

 
Marco Tenuti - www.tencas.com

AnswerRe: An offline installermemberTed Ehrich8 Nov '06 - 13:42 
If I understand you correctly, the dependency installers simply need to be placed in a "dependencies" folder (which is mentioned in the article). The script will check that folder before attempting to download them from the internet.
GeneralInstShellExecmemberpana200610 Aug '06 - 6:17 
I got unknown identifier for "InstShellExec" and "InstExec".
What is wrong?
 
Thanks
GeneralRe: InstShellExec [modified]memberTed Ehrich13 Aug '06 - 17:02 
Replace them with ShellExec
 
More specifically, this is how the code I'm using looks now:
 

      if FileExists(iePath) then begin
         MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Setup will now exit and begin the IE 6 installation.', mbInformation, MB_OK);
         ShellExec('open', iePath, '', '', SW_SHOW, ewNoWait, nRet);
      end else begin
         if MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Would you like to visit the download site now?', mbConfirmation, MB_OKCANCEL) = IDOK then
            ShellExec('open', 'http://www.microsoft.com/ie', '', '', SW_SHOW, ewNoWait, nRet);
      end;
 

The Inno guys changed the name.
 
Cheers.
 

-- modified at 23:07 Sunday 13th August, 2006
GeneralNote: The Microsoft URL's are outdatedmemberTed Ehrich26 Apr '06 - 14:05 
Apparenlty MS likes to change the URL's for their download's periodically. This means that some of the URL's in the script don't work anymore. You should either update them, or for future compatibility, move the files to a server you operate.
GeneralRe: Note: The Microsoft URL's are outdated [modified]memberSolel24 Aug '06 - 23:05 
Hi Ted,
 
Thank you for sharing such tremendously useful code. It has saved me untold hours of frustration dealing with Jet-MDAC-.Net interdependencies! The only URL that is out of date is Jet since Microsoft released SP8. Here are the updated sections for anyone who uses it:
 
In the "const" section change the download URL:
 

jetURL = 'http://download.microsoft.com/download/4/3/9/4393c9ac-e69e-458d-9f6d-2fe191c51469/Jet40SP8_9xNT.exe';

 
Replace this section to update the file name:
 

// Check for required Jet installation
// Jet is not included in MDAC 2.5+. It will be needed on NT4 installations.
if (not exclusiveNeeded) and (not RegKeyExists(HKLM, 'Software\Microsoft\Jet\4.0')) then begin
memoDependenciesNeeded := memoDependenciesNeeded + ' Jet 4.0 Database Components' #13;
jetPath := ExtractFileDrive(ExpandConstant('{src}')) + '\dependencies\Jet40SP8_9xNT.exe';
if not FileExists(jetPath) then begin
jetPath := ExpandConstant('{tmp}\Jet40SP8_9xNT.exe');
if not FileExists(jetPath) then begin
isxdl_AddFile(jetURL, jetPath);
downloadNeeded := true;
end;
end;
SetIniString('install', 'jet', jetPath, ExpandConstant('{tmp}\dep.ini'));
end;

 
-- modified at 5:06 Friday 25th August, 2006
GeneralGreat work - have u tried .NET 2.0 with it? [modified]memberLightingToGo2 Mar '06 - 7:27 
First wanted to say thanks very much for your contribution, it's really useful.
 
I was thinking of modifying it work with .NET 2.0 and XP only which would simplify a bit a drop the IE requirement.
 
If you've done any more recent work on this please post back.
 
Regards -
ecards
 
modified on Sunday, August 24, 2008 12:20 PM

GeneralRe: Great work - have u tried .NET 2.0 with it?memberTed Ehrich26 Apr '06 - 14:26 
No I haven't, but if you do come up with a port, please post it. I might switch to .NET 2.0/VS.NET 2005 in the future, but ATM I have no reason to.
AnswerDetecting .NET 2.0memberrazva28 Oct '06 - 11:01 
Just check the registry for v2.0 :
[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
    Result1 := MsgBox('This setup requires the .NET Framework v2.0. Please download and install the .NET Framework v2.0 and run this setup again. Do you want to download the framwork now?',
      mbConfirmation, MB_YESNO) = idYes;
    if Result1 =false then
    begin
      Result:=false;
    end
    else
    begin
     Result:=false;
      ShellExec('open', 'http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
    end;
  end;
end;
Roll eyes | :rolleyes:
Good luck!

GeneralScript errormembernmg1968 Jul '05 - 1:59 
Hi,
 
I think there is an error in the script:
 
RegQueryStringValue(HKLM, 'Software\Microsoft\Internet Explorer', 'Version', sRet);
if downloadNeeded and (sRet < '3') then begin
 
Doesn't this check that IE 3 is installed rather than IE6?
 
IE 6 is required for .NET AFAIK.
 
Please let me know how to fix this. I presume you can't just change the 3 to a 6 because the value it's reading is not an integer - it's a version number like 6.0.2900.2180.
 
Thanks,
 
Nick...
GeneralRe: Script errormemberTed Ehrich26 Apr '06 - 14:24 
Hi,
 
That part of the script deals isxdl being unable to download files. It needs IE3 or later installed, and yes, I have an NT4 CD that ships with IE2.
 
About the version string: I'm not a pascal programmer, but I'll try to answer your question. Either pascal treats the string as a number, ending at the first or second decimal, or it does a string comparison on the 3 and 6, for example. EG, "a" < "b" because a is lower than b in the ascii character table.
GeneralRe: Script errormembernmg19626 Apr '06 - 22:33 
But .NET requires IE6, so why not check they have that as well? I don't really understand why it only checks for IE3, since if IE6 isn't installed then .NET won't work.
 
Nick...
GeneralRe: Script errormemberTed Ehrich27 Apr '06 - 6:49 
It does check for IE6. If anything less than IE5 is installed, it installs 6. It says so in the article, but here's the relevant part in the script:
 

// Check for required IE installation
// Note that if IE 6 is downloaded, the express setup will be downloaded, however it is the same
// ie6setup.exe that would be available in the ie6full folder. The only difference is that the
// user will be presented with an option as to where to download IE 6 and a progress dialog.
// Most common components will still be installed automatically.
sRet := '';
RegQueryStringValue(HKLM, 'Software\Microsoft\Internet Explorer', 'Version', sRet);
if (not exclusiveNeeded) and (sRet < '5') then begin
exclusiveNeeded := true;
MsgBox('Internet Explorer 6 must be installed before Setup can install the application. Setup will attempt to install IE 6 for you. After the computer reboots, please run Setup again.', mbInformation, MB_OK);
memoDependenciesNeeded := memoDependenciesNeeded + ' Internet Explorer 6' #13;
iePath := ExtractFileDrive(ExpandConstant('{src}')) + '\dependencies\ie6full\ie6setup.exe';
if not FileExists(iePath) then begin
iePath := ExpandConstant('{tmp}\ie6setup.exe');
if not FileExists(iePath) then begin
isxdl_AddFile(ieURL, iePath);
downloadNeeded := true;
end;
end;
SetIniString('install', 'ie', iePath, ExpandConstant('{tmp}\dep.ini'));
end;

 
Also, .NET 1.1 only requires IE 5. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/NETFx1Redistreq1_1.asp
 
-- modified at 12:50 Thursday 27th April, 2006
GeneralRe: Script error [modified]memberGlaucioSilva14 May '09 - 4:21 
Microsoft's articles KB164539 and KB969393 shows that IE3 version is 4.70.1155, but anyway the "Version" value in that registry key only exists on IE4 and later.
 
modified on Thursday, May 14, 2009 2:50 PM

GeneralProblem with ISTools Updatememberstroi28 Dec '04 - 10:49 
Hi,
first of all an absoulutely thanks to you for this tool!!!
 
It seems to me, that the new edition of ISTools brings some problems:
InstExec() is no longer available
InstShellExec is also no longer available
 
and SkipCurPage must be chaged to ShouldSkipPage!
this was the only thing I could change succesfully!
Does anyone know how to fix the rest of it, listed below?
 
Or has somebody still got the old Versions files?
thanks!
Michi
 
if FileExists(iePath) then begin
MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Setup will now exit and begin the IE 5 installation.', mbInformation, MB_OK);
InstExec(iePath, '', '', false, false, 0, nRet);
end else begin
if MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Would you like to visit the download site now?', mbConfirmation, MB_OKCANCEL) = IDOK then
InstShellExec('http://www.microsoft.com/windows/ie/downloads/recommended/ie501sp2/default.asp', '', '', SW_SHOWNORMAL, nRet);
end;

GeneralRe: Problem with ISTools Updatememberstockman0127 Apr '05 - 11:13 
Here's what I did, didnt test it but compiles
 
if FileExists(iePath) then begin
MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Setup will now exit and begin the IE 6 installation.', mbInformation, MB_OK);
Exec(iePath, '', '', SW_SHOWNORMAL, ewNoWait, nRet);
end else begin
if MsgBox('Internet Explorer 5 (or later) must be installed manually before Setup can continue.' #13#13 'Would you like to visit the download site now?', mbConfirmation, MB_OKCANCEL) = IDOK then
ShellExec('open', 'http://www.microsoft.com/ie', '', '', SW_SHOWNORMAL, ewNoWait, nRet);
end;

GeneralThanks much!memberOkeno Palmer11 Oct '04 - 21:17 
I've been looking for something like this for a while now. I also want to check for the existence of JRE so I will attempt to tweak the script and see if I can get that going as well.
 
.:. Keno .:.
GeneralFind pathmembernaormeir28 Jun '04 - 20:33 
Hi
The .NET Framework 1.1 requires only MDAC 2.6 and not MDAC 2.8.
How can i find the exact path to download it from the internet?
Also id the only change in the code I have to do is in line 118:
   if (not exclusiveNeeded) and (sRet < '2.6') then begin
Instead:
   if (not exclusiveNeeded) and (sRet < '2.6') then begin
 
(Beside of course the path change)
 
Thanks,
Naor
GeneralFix for Win98SEsussAndreas Wente2 Jun '04 - 1:13 
Didn't work in my Win98SE-Ger VM. Here are the changes I made to fix it:
 

Line 75:
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows NT\CurrentVersion', 'CurrentVersion', sRet) then begin
Line 89:
Insert an end;
and Change the IE Version-Check around Line 100 from
if (not exclusiveNeeded) and (sRet < '5') then begin
to
if (not exclusiveNeeded) and (sRet < '5.01') then begin


GeneralRe: Fix for Win98SE [modified]memberGlaucioSilva14 May '09 - 4:18 
Actually, the IE Version-Check you mention only needs to make sure the IE version is 3 or superior, in order to allow the setup to download the installers.
Microsoft's articles KB164539 and KB969393 shows that IE3 version is 4.70.1155, but anyway the "Version" value in that registry key only exists on IE4 and later.
 
modified on Thursday, May 14, 2009 2:54 PM

GeneralMissing isxdl.issmemberanandasim25 May '04 - 21:50 
New to this. The first line is:
 
#include "C:\Program Files\ISTool 4\isxdl.iss"
 
pray tell where is that file? It's not in the download.Confused | :confused:
GeneralRe: Missing isxdl.issmemberAsper3326 May '04 - 18:12 
It's from other great tool for InnoSetup, ISTool
GeneralRe: Missing isxdl.issmemberGrut26 May '04 - 21:52 
I installed ISTool but still can't find isxdl.iss file ...
Does anyone knows where it is exactly ?
 
Thanks for the post, seems to be really good Smile | :)
GeneralRe: Missing isxdl.issmemberAsper3327 May '04 - 4:58 
I'm sorry, I wasn't clear. From www.istool.org you need to download "ISX Download Dll". It's important, because that article uses it. After installation you will find the isxdl.iss.
 
Yes, the post is great, I'm gonna use it to prepare installation of my project. Thank you, Ted!
GeneralRe: Missing isxdl.issmembersoslo23 Jan '05 - 16:26 
The ISTool link is broken - can anyone post this or email it to aaronmurray_at_msn.com ?
Thanks!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 23 May 2004
Article Copyright 2004 by Ted Ehrich
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid