View Full Version : .NET 3.0 Dependency makes my installer too large (50MB) are there any alternatives?
Alphaman5000
07-06-2009, 11:10 AM
Hello,
I require .NET 3.0 to be installed on the machine, so I added the .NET 3.0 dependency to my installer. The resulting exe is 50MB large. I think it is too large. Is there another approach I can use that will result in a smaller exe.
Thanks,
Rilwan.
Ulrich
07-06-2009, 02:24 PM
Hello,
you could use the dependency module to check if .NET is not installed, and then download the installer from your own web server to a temporary location. Once downloaded, run the installer, delete it, then resume the setup of your product.
Ulrich
ShadowUK
07-06-2009, 02:46 PM
If I recall correctly, .NET 3.0 was a web installation, So can't you just pack the End User package?
Alphaman5000
07-06-2009, 11:46 PM
Hello,
I will rather check for .NET 3.0 and exit the installation if the user does not have it and display a message to the user asking the user to go install it.
How do I check for .NET 3.0 with script code?
How do I display a message to the user right before I exit the installation, if the user does not have .NET 3.0 installed. I will like to display a link to the download page for .NET 3.0 redistributable.
Thanks.
jassing
07-07-2009, 11:14 AM
Here's some code out of my tool kit
function GetDotNetVer()
-- determine DotNet version()
-- by jAssing (IR forums or josh@jAssing.com)
local cDotVer = "";
if Registry64.DoesKeyExist(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\.NETFramework","InstallRoot") then
local cPath = Registry64.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework", "InstallRoot", false);
-- This next line is needed for 64bit OS's -- just to make the rest of the code "work"
cPath = String.Transform( cPath, "framwork64", "Framework", false);
if cPath ~= nil and Folder.DoesExist( cPath ) then
local tDotNetFolders = Folder.Find(cPath, "v*.*", false, nil);
if tDotNetFolders ~= nil then
Table.Sort(tDotNetFolders,nil);
if File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscorwks.dll" ) then
--1.1 or later
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscorwks.dll" ).FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscormmc.dll" ) then
-- 1.0
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscormmc.dll" ).FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\Windows Communication Foundation\\SMDiagnostics.dll") then
-- 2.0
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\Windows Communication Foundation\\SMDiagnostics.dll").FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\csc.exe") then
-- 3.5
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\csc.exe").FileVersion;
else
SetupData.WriteToLogFile("INFO\tNo files found in", tDotNetFolders[ Table.Count(tDotNetFolders) ]);
end
end
end
end
-- SetupData.WriteToLogFile("INFO\t.net version determined "..cDotVer.."\r\n",true);
return cDotVer;
end
That will tell you what version it detected (only works to 3.5...)
Then in your OnStartup, just issue a Dialog.Message() if you don't detect the proper version.
Alphaman5000
07-08-2009, 01:11 PM
Thanks a lot.
Alphaman5000
07-08-2009, 10:47 PM
Hello,
When I integrated the code you provided, I discovered that Registry64 and String.Transform was not available in my SetUp Factory 8.0 installation. I modified the script to work as shown below:
function GetDotNetVer()
-- determine DotNet version()
-- by jAssing (IR forums or josh@jAssing.com)
local cDotVer = "";
if Registry.DoesKeyExist(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\.NETFramework","InstallRoot") then
local cPath = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework", "InstallRoot", false);
if cPath ~= nil and Folder.DoesExist( cPath ) then
local tDotNetFolders = Folder.Find(cPath, "v*.*", false, nil);
if tDotNetFolders ~= nil then
Table.Sort(tDotNetFolders,nil);
if File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscorwks.dll" ) then
--1.1 or later
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscorwks.dll" ).FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscormmc.dll" ) then
-- 1.0
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ].."\\mscormmc.dll" ).FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\Windows Communication Foundation\\SMDiagnostics.dll") then
-- 2.0
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\Windows Communication Foundation\\SMDiagnostics.dll").FileVersion;
elseif File.DoesExist( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\csc.exe") then
-- 3.5
cDotVer = File.GetVersionInfo( tDotNetFolders[ Table.Count(tDotNetFolders) ] .. "\\csc.exe").FileVersion;
else
SetupData.WriteToLogFile("INFO\tNo files found in", tDotNetFolders[ Table.Count(tDotNetFolders) ]);
end
end
end
end
-- SetupData.WriteToLogFile("INFO\t.net version determined "..cDotVer.."\r\n",true);
return cDotVer;
end
local DotNetVersion = GetDotNetVer();
if DotNetVersion == nil then
DotNetVersion = "1.0"
end
--Dialog.Message("Notice", DotNetVersion, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
local result2 = String.Left(DotNetVersion, 3);
--Dialog.Message("Notice", result2, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
local result = String.ToNumber(result2);
--Dialog.Message("Notice", result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
if result < 3.5 then
result = Dialog.Message("Installation requirement is missing", " Microsoft .NET Framework 3.5 must be installed before Related Products Slideshow Builder is installed. Microsoft .NET 3.5 Framework download can be downloaded for free at http://www.microsoft.com/downloads/en/default.aspx", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
Application.Exit(0);
end
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.