Skip to content

Instantly share code, notes, and snippets.

@jclement
Created January 7, 2013 22:34
Show Gist options
  • Save jclement/4479168 to your computer and use it in GitHub Desktop.
Save jclement/4479168 to your computer and use it in GitHub Desktop.
Helper code to push Crystal Reports folder into Environment to help with periodic startup issues
static void SetCrystalPath()
{
string crpath;
if (Environment.Is64BitProcess)
{
crpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64";
}
else
{
crpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86";
}
Environment.SetEnvironmentVariable("path", Environment.GetEnvironmentVariable("path") + ";" + crpath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment