|
#1
|
|||
|
|||
|
How to Detect and Download .Net Framework
In spite of the few .Net Dependancies Examples on this board they all required .Net Framework to be included with the installer, bloating the size outlandishly. Take for example .Net Framework 3.5 Redistribution is 198Mb so to include this with a installation was out of the question for me so I created these functions to handle detecting if .Net Framework 3.5 was installed and if not Download it and install.
Enjoy, comments and suggestions are welcome! Code:
function CheckReg()
myVar = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Net Framework Setup\\NDP\\v3.5","Version", true); -- Detects .Net Framework Version 3.5
if (myVar == "") then
--Framework not found
Dialog.Message(".Net Framework Version",".Net Framework Version 3.5 was not found, Setup will now try and download and install it!", MB_OK);
GetFramework();
else
--Framework found!
UpdateNextButton(); -- CHANGE THIS TO MATCH YOUR SCREEN BUTTONS
end
end
function GetFramework()
local Framework_Installed
-- Check to see if the user is connected to the internet
connected = HTTP.TestConnection("http://www.indigorose.com", 20, 80, nil, nil);
-- If they are connected.
if connected then
--If not found then download framework
URL = "http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe"; -- URL for .Net Framework 3.5 Redist (198Mb)
-- Download a file to their temporary directory.
StatusDlg.Show(MB_ICONNONE, false);
HTTP.Download(URL, SessionVar.Expand("%TempFolder%\\dotnetfx35.exe"), MODE_BINARY, 20, 80, nil, nil, nil);
-- Get any error codes that may have been returned by the download action.
error = Application.GetLastError();
StatusDlg.Hide();
-- If there was an error during the download, display the error message.
if error ~= 0 then
result = Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
-- If there was no error during the download.
else
-- Run the exectuable that was downloaded.
File.Run(SessionVar.Expand("%TempFolder%\\dotnetfx35.exe", "", "", SW_SHOWNORMAL, true));
end
else
Dialog.Message("Internet Connection Error", "Setup could not detect a internet connection, please connect and try again!")
end
|
|
#2
|
|||
|
|||
|
Hello,
i'm very new in Setup Factory and have problems to detect the Framework. Wow is your script exactly to use ? The Problem is where have i to add your script and what about the UpdateNextButton(); funktion ? Please can i have a exactly example ? Thanks and a happy new year all !! Matthias |
|
#3
|
|||
|
|||
|
Has the script posted by Scorn been verified by an IndioRose member?
|
|
#4
|
||||
|
||||
|
I have derived a new detection module from the original .NET 3.5 SP1 framework dependency module that ships with Setup Factory. My version will use the bootstrapper (2.82 MB) instead of the full installer (almost 200 MB). If the .NET framework is not detected, it will start the bootstrapper, which, using some progress dialogs, will download and install the required files for the computer where it is run. After the framework was deployed, your installer will continue.
You find the installer here. Ulrich |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dependency Module: Microsoft .NET Framework 2.0 | Adam | Setup Factory 8.0 Examples | 30 | 1 Day Ago 09:27 PM |
| Dependency Module: Microsoft .NET Framework 1.1 | Darryl | Setup Factory 8.0 Examples | 12 | 06-10-2008 03:26 AM |
| User was able to detect that there's an update, but fails to download from the HTTP | Elleah | TrueUpdate 2.0 | 8 | 06-15-2005 01:15 PM |
| Microsoft .NET Framework | cap808 | Setup Factory 6.0 | 4 | 05-02-2005 06:27 AM |
| download fails, how to detect? | intel352 | Setup Factory 6.0 | 1 | 03-29-2003 02:17 PM |
All times are GMT -6. The time now is 04:15 AM.








Linear Mode

