export prototype CheckForMemoryAndDiskSpace(OBJECT); function CheckForMemoryAndDiskSpace(oExtension) STRING szFreeSpace, svRam, szSupportFolder, szProgram, szParam, szTempFolder, svResult; _DISK_INFO di; NUMBER n, nFileHandle, nRam; // to do: something with function return values NUMBER nvSizeTargetHigh, nvSizeTargetLow, nUnitsTarget; begin try SuiteLogInfo("Function CheckForMemoryAndDiskSpace started"); // init. _DISK_INFO members: what drive, what info di.szDiskPath = TARGETDIR; di.nInfoToQuery = DISK_INFO_QUERY_DISK_FREE_SPACE; n = GetDiskInfo(&di); // change to desired unit for free space nUnitsTarget = GBYTES; n = ConvertSizeToUnits( di.nFreeSpaceHigh, di.nFreeSpaceLow, BYTES, nvSizeTargetHigh, nvSizeTargetLow, nUnitsTarget); NumToStr(szFreeSpace, nvSizeTargetLow); SuiteLogInfo("Free Disk Space available is " +szFreeSpace+" MB"); if (nvSizeTargetLow < 50) then //Check if Disk Space is less than 50 GB, stop installation. SuiteLogInfo("Diskspace not sufficient for installation [less than 50GB]. Installation will be stopped."); SuiteSetProperty("DISKSPACESUFFICIENT", szFreeSpace); else SuiteLogInfo("Diskspace sufficient for installation. Continuing with Installation.."); SuiteSetProperty("DISKSPACESUFFICIENT", "0"); endif; //To check for RAM SuiteGetProperty("SETUPSUPPORTDIR", szSupportFolder); szProgram = szSupportFolder +"\RAM_Check.bat"; szParam = ""; LaunchAppAndWaitEx(szProgram, szParam); SuiteGetProperty("TempFolder", szTempFolder); if (FindFile (szTempFolder, "RAM_Details.txt", svResult) < 0) then SuiteLogInfo("Unable to detect RAM details. Supporting file not found. Installation might fail."); SuiteSetProperty("RAMSUFFICIENT", "1"); else // Set the file mode to normal. OpenFileMode (FILE_MODE_NORMAL); // Open the file for editing. OpenFile (nFileHandle, szTempFolder, "RAM_Details.txt"); // Get first line from the file into svLine. GetLine (nFileHandle, svRam); SuiteLogInfo("RAM details found: "+svRam+" MB."); StrToNum(nRam, svRam); if (nRam < 15360) then //Ram should be 16 GB or More, else throw Warning. We are checking for 15GB as the Ram size varies for 16GB or more. SuiteLogInfo("RAM not sufficient for installation [less than 16GB]. Installation might fail."); SuiteSetProperty("RAMSUFFICIENT", svRam); SuiteSetProperty("ISInstallStatus", @IDS_SUITE_INTERRUPTED); else SuiteLogInfo("RAM sufficient for installation. Continuing with Installation.."); SuiteSetProperty("RAMSUFFICIENT", "0"); endif; // Close the file. CloseFile (nFileHandle); endif; SuiteLogInfo("Function CheckForMemoryAndDiskSpace ended"); catch endcatch; end;