Hope this helps you ...
#define MyAppName "RAM SIZE" #define MyAppVersion "1.5" #define MyAppPublisher "My Company, Inc." #define MyAppURL "http://www.example.com/" #define MyAppExeName "MyProg.exe" [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{5DC352AD-7D20-41C8-9372-B174BDE452CB} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} CreateAppDir=no OutputBaseFilename=setup Compression=lzma SolidCompression=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [code] procedure initializeWizard; var i,ramsize:integer; resultcode:integer; TmpFileName,ExecStdout,tempstr:string; begin TmpFileName := ExpandConstant('{tmp}') + '\systeminformation.txt'; Exec('cmd.exe', '/C systeminfo |find "Total Physical Memory" > "' + TmpFileName + '"', '', SW_HIDE,ewWaitUntilTerminated, ResultCode); if LoadStringFromFile(TmpFileName, ExecStdout) then begin deletefile(TmpFileName); ExecStdout:=copy(Execstdout,27,6); for i:=1 to length(Execstdout) do begin if ((Execstdout[i]>='0') and (Execstdout[i]<='9'))then tempstr:=tempstr+Execstdout[i]; end; ramsize:=strtoint(tempstr); Msgbox('RAM SIZE OF THIS SYSTEM IS : '+tempstr+' MB' ,mbinformation,mb_ok); Msgbox('RAM SIZE OF THIS SYSTEM IS : '+inttostr(ramsize)+' MB' ,mbinformation,mb_ok); if ramsize<1024 then Msgbox('Warning:RAM SIZE IS LESS THAN 1 GB , Do you want to proceed ',mbinformation,mb_yesno); //result is IDYES if you press yes then contiue after check.. end; end;
source share