Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Go Back  Xtreme Visual Basic Talk > > > Install Crystal Report with vb.net 2010


Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2012, 06:06 AM
crazycat crazycat is offline
Newcomer
 
Join Date: Oct 2010
Posts: 7
Default Install Crystal Report with vb.net 2010


I use setup factory to distribute my net based program and it works awesome except for crystal report. I donno which file to distribute, which dll's...included shared.dll and engine.dll of crystal report but nothing. Then tried to distribute hte redistrubtable version of crystal report within my setup but still it failed.

How does one distribute crystal report with vb.net exe programs?
Reply With Quote
  #2  
Old 04-24-2012, 11:53 AM
Zdenek Zdenek is offline
Newcomer
 
Join Date: Mar 2004
Location: Prague
Posts: 3
Default

If your program uses dotNET features, you will, unfortunately, have to download a "redistributable offline package" of the version of .NET you are using. It is a big file. .NET 2.0 takes up 20MB IIRC and the newer ones grow bloated as ever. You can either place the installer side-by-side with your Setup Factory installer and make it required, or you can have it compressed (no size gain) into the installer, then, during installation, extract it into a temporary directory, run it with the -s (IIRC) parameter to make it install by itself, wait for it to end, then optionally delete from the temporary directory.
Reply With Quote
  #3  
Old 04-26-2012, 07:08 AM
crazycat crazycat is offline
Newcomer
 
Join Date: Oct 2010
Posts: 7
Default

i download that...for 2005, it uses the following codes in setup factory:

Code:
function isCrystalReports2005_Installed()
    -- Write to logfile that detection has started.
	SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Detection script started.\r\n",true);

	if (MSI.GetProductInfo("{7C05EEDD-E565-4E2B-ADE4-0C784C17311C}", "ProductName") == nil) then
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Product not detected.\r\n",true);
		return false;
	else
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Product already installed (or advertised).\r\n",true);
		return true;
	end
end
And installation codes

Code:
-- Variables
-- Whether to prompt the user for confirmation before running the Crystal Reports 2005 installer.
local bShowUserPrompt = true;
-- Whether the Crystal Reports 2005 installation is vital.
local bVital = true;

function isDotNet20_Installed()
	-- Output to the log that the .NET detection has started.
	SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: .NET 2.0 detection script started.\r\n", true);

	--Check to see if the registry key exists
	local DotNet_Registry = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\.NETFramework");

	if (DotNet_Registry == false) then
		-- The registry key does not exist
		-- Run the .NET Installation script
		-- Output to the log file that .NET could not be found, so it will be installed.
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: No version of .NET 2.0 was found.\r\n", true);
		return false;
	else -- The key does exist

		-- Get the .NET install location from the registry
		local DotNet_Install_Location = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\.NETFramework", "InstallRoot", true);
		-- Look for the file mscorcfg.dll
		Does_File_Exist = File.Find(DotNet_Install_Location.."\\v2.0.50727\\", "mscorrc.dll", true, false, nil);

		if (Does_File_Exist == nil) then
			-- The file does not exist
			-- Run the .NET Installation script
			-- Output to the log file that .NET could not be found, so it will be installed.
			SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: No version of .NET 2.0 was found.\r\n", true);
			return false;

		else -- The file does exist

			-- Get the version of mscorcfg.dll
			msc_ver = File.GetVersionInfo(Does_File_Exist[1]);

			-- Compare the returned value against the needed value
			Compare = String.CompareFileVersions(msc_ver.FileVersion, "2.0.50727.42");


			if (Compare == 0 or Compare == 1) then
				-- .net version 2.0 is installed already
				return true;
			else
				-- a version less than version 2.0 is installed
				-- Output to the log file that a lesser version of .NET was found on the system
				SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: A lesser version of .NET was found on the users system.\r\n", true);
				return false;
			end
		end
	end
end

if (not isDotNet20_Installed()) then
	if not bVital then
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: .NET 2.0 check failed, but module not marked at vital - setup will continue.\r\n",true);
		Application.ExitScript();
	else
		local strMessageTitle = "Crystal Reports 2005 Installation";
		local strMessageAbort = "You do not have the Microsoft .NET Framework 2.0 or greater installed on your system. This product requires the .NET Framework 2.0 to be installed before the setup can continue. The setup will now abort.";

		Dialog.Message(strMessageTitle,strMessageAbort,MB_OK,MB_ICONSTOP);
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: .NET 2.0 check failed, setup will abort.\r\n",true);
		Application.Exit(225);
	end
end

if(not isCrystalReports2005_Installed())then
	-- Messages
	local strMessage = [[Setup has detected that you do not have Crystal Reports 2005 installed.
Click OK to install this technology now or Cancel to abort the setup.]];
	local strMessageTitle = "Crystal Reports 2005 Installation";
	local strMessageFail = [[The installation of Crystal Reports 2005 failed.
The setup will now close.]];
	local strMessageCancelled = [[The installation of Crystal Reports 2005 was cancelled.
The setup will now close.]];
	local strRuntimeSupportFolder = SessionVar.Expand("%TempLaunchFolder%\\crystalreports2005");
	local strInstallerDest = "";

	if (System.Is64BitOS()) then
		strInstallerDest = strRuntimeSupportFolder.."\\CRRedist2005_x86.msi";
	else
		strInstallerDest = strRuntimeSupportFolder.."\\CRRedist2005_X64.msi";
	end

	-- Write to logfile that installation has started.
	SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Installation script started.\r\n",true);

	local MessageBoxResult = IDOK;

	if bShowUserPrompt then
		MessageBoxResult = Dialog.Message(strMessageTitle,strMessage,MB_OKCANCEL,MB_ICONEXCLAMATION,MB_DEFBUTTON1);
	end

	if (MessageBoxResult == IDOK) then
		local nError = Application.GetLastError();
		if(nError == 0)then
			-- Run the installer:
			SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Install extraction successful:"..strInstallerDest.."\r\n",true);

			strCmdArgs = "-i \"" ..strInstallerDest .. "\" /passive /norestart";

			SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Using command line:"..strCmdArgs.."\r\n",true);
			local nSetupResult = MSI.RunMsiexec(strCmdArgs, true);
			nError = Application.GetLastError();

			if nError ~= 0 then
				SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: MSI.RunMsiexec action failed with code:"..nError.."\r\n",true);
				Dialog.Message(strMessageTitle,strMessageFail.."\r\n".._tblErrorMessages[nError],MB_OK,MB_ICONSTOP);
				if bVital then
					SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Setup will abort.\r\n",true);
					File.Delete(strInstallerDest);
					Application.Exit(202);
				else
					SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Setup will continue.\r\n",true);
					File.Delete(strInstallerDest);
					Application.ExitScript();
				end
			else
				-- File.Run was successful:
				SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Setup finished. Process return code:"..nSetupResult.."\r\n",true);

				if nSetupResult == 0 then
					-- OK
					SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Crystal Reports 2005 setup successful.\r\n",true);
				elseif nSetupResult == 1602 then
					-- Aborted by user
					Dialog.Message(strMessageTitle, strMessageCancelled, MB_OK, MB_ICONEXCLAMATION);
					SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Crystal Reports 2005 installation canceled.\r\n",true);
					Application.Exit(201);
				else
					-- Some other error
					SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Crystal Reports 2005 installation failed with code:"..nSetupResult.."\r\n",true);
					if bVital then
						SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Setup will abort.\r\n",true);
						File.Delete(strInstallerDest);
						Dialog.Message(strMessageTitle,strMessageFail.."\r\nSetup returned code:"..nSetupResult,MB_OK,MB_ICONSTOP);
						Application.Exit(203);
					else
						SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Setup will continue.\r\n",true);
						File.Delete(strInstallerDest);
						Application.ExitScript();
					end
				end
			end
		else
			Dialog.Message(strMessageTitle,strMessageFail.."\r\n".._tblErrorMessages[nError],MB_OK,MB_ICONSTOP);
			if bVital then
				SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Install extraction failed, setup will abort.\r\n",true);
				Application.Exit(200);
			else
				SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Install extraction failed, setup will continue.\r\n",true);
			end
		end
	else -- IDCANCEL
		-- Do not install Crystal Reports 2005 and log to file
		Dialog.Message(strMessageTitle, strMessageCancelled, MB_OK, MB_ICONEXCLAMATION);
		SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: File installation canceled.\r\n",true);
		Application.Exit(201);
	end

	File.Delete(strInstallerDest);

	-- Write to logfile that installation has finished.
	SetupData.WriteToLogFile("Info\tCrystal Reports 2005 Module: Installation script finished.\r\n",true);
end
I cant figure out how to change that to detect CR 2008 for VS 2010. No documentation at SAP or VS2010
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010 Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
 
Install Crystal Report with vb.net 2010
Install Crystal Report with vb.net 2010
 
-->