dmitrybv 5 Posted yesterday at 12:50 PM Hello, How can I programmatically determine the edition of RAD Studio 12.3? In the registry key Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\23.0, there is no value named Edition. I have the same question regarding RAD Studio 11.3 and 10.4. Share this post Link to post
Anders Melander 2015 Posted yesterday at 01:31 PM (edited) GetRTLVersion would be my guess. The actual values appears to be undocumented though - but here's an unofficial list to get you started: https://delphidabbler.com/notes/version-numbers Edited yesterday at 01:32 PM by Anders Melander Share this post Link to post
dmitrybv 5 Posted yesterday at 01:37 PM 4 minutes ago, Anders Melander said: GetRTLVersion would be my guess. The actual values appears to be undocumented though. 1. RTLVersion and RAD Studio Edition (Professional, Enterprise, Community Edition) are different concepts. 2. RTLVersion for RAD Studio 12.3 cannot be called from an external program. Share this post Link to post
Anders Melander 2015 Posted yesterday at 01:45 PM Just now, dmitrybv said: 1. RTLVersion and RAD Studio Edition (Professional, Enterprise, Community Edition) are different concepts. 2. RTLVersion for RAD Studio 12.3 cannot be called from an external program. Oh - You meant what version of RAD Studio is installed on the local system. I think the InstalledUpdates registry key is the closest you can get. There's no guarantee that it's valid though since it's only informational. Share this post Link to post
Cristian Peța 122 Posted 23 hours ago I don't have an answer but the edition is in the license. And I don't think there is a public API to read it. But if you run ddc32 with different small projects the messages can tell you something about this. Share this post Link to post
Die Holländer 88 Posted 23 hours ago There is this small component I use for ages (CEVersionInfo) that takes the version info from the Delphi IDE. (Menu-Projects-Project Options-Version Info) In the IDE I put the Delphi version name into the "Comments" field and in the program source you can use it just like: "myEdit.Text:=CEVersionInfo.Comments" I've searched the web for the component but only saw some sites where I didn't dare to click to.. I'm willing to publish the source because there is no copyright involved and it is quite small code. It can take the following info fields: FCompanyname :='<info not available>'; FFileDescription :='<info not available>'; FFileVersion :='<info not available>'; FInternalname :='<info not available>'; FLegalCopyright :='<info not available>'; FLegalTradeMarks :='<info not available>'; FOriginalFilename :='<info not available>'; FProductName :='<info not available>'; FProductVersion :='<info not available>'; FComments :='<info not available>'; FMajorVersion :='<info not available>'; FMinorVersion :='<info not available>'; FRelease :='<info not available>'; FBuild :='<info not available>'; Share this post Link to post
aehimself 404 Posted 17 hours ago As this information might be useful I added TAEIDEVersion.Edition and TAEIDEVersion.ExecutableVersion to my installed version / instance detection component. Tested with TAEDelphiVersion, seems to return correct values. Share this post Link to post
Kazantsev Alexey 28 Posted 17 hours ago 7 hours ago, dmitrybv said: How can I programmatically determine the edition of RAD Studio 12.3? Look at https://docwiki.embarcadero.com/RADStudio/Alexandria/en/IDE_Command_Line_Switches_and_Options for bds.exe /ProductInfo:SKU Share this post Link to post
Dave Nottage 618 Posted 16 hours ago 8 hours ago, dmitrybv said: How can I programmatically determine the edition of RAD Studio 12.3? From within the IDE? Use IOTAVersionSKUInfoService. Example: var LSKUInfoService: IOTAVersionSKUInfoService; begin LSKUInfoService := BorlandIDEServices as IOTAVersionSKUInfoService; Label1.Caption := Format('SKU: %s (%d)', [LSKUInfoService.SKUName, LSKUInfoService.SKU]); end; Oddly, for SKU the docs say: /// <summary> /// Return SKU identifier, possible values are: /// /// Professional = 2 /// Professional C/S = 3 /// Enterprise = 4 /// Architect = 5 /// CommunityEdition = 128 /// </summary> ..but in my install of Delphi (Enterprise), it returns 52. The SKUName value appears to be correct for me, though Share this post Link to post
dmitrybv 5 Posted 7 hours ago Actually I need to determine the edition of RAD Studio from an external program, from my installer program, in order to understand whether I can use dcc32.exe to compile the library source codes to generate packages for installation or not. RAD Studio 12.3 Community Edition does not support compilation via dcc32.exe. I am trying to understand how I can determine in advance in the LibInstaller program whether I can generate packages and install the library in the IDE or not. Share this post Link to post
DelphiUdIT 244 Posted 7 hours ago (edited) Wrong answer ... Edited 7 hours ago by DelphiUdIT Share this post Link to post
dummzeuch 1656 Posted 6 hours ago 24 minutes ago, dmitrybv said: Actually I need to determine the edition of RAD Studio from an external program, from my installer program, in order to understand whether I can use dcc32.exe to compile the library source codes to generate packages for installation or not. RAD Studio 12.3 Community Edition does not support compilation via dcc32.exe. I am trying to understand how I can determine in advance in the LibInstaller program whether I can generate packages and install the library in the IDE or not. Does the executable dcc32.exe exist in that case? If not, there's your answer. If yes and it only outputs an error message or something, you could do exactly that: Call it and check for that error. Share this post Link to post
dmitrybv 5 Posted 6 hours ago dcc32.exe is present in RAD Studio 12.3 Community Edition. It runs without errors. After running dcc32.exe %ERRORLEVEL% = 0. Share this post Link to post
Die Holländer 88 Posted 6 hours ago 1 minute ago, dmitrybv said: dcc32.exe is present in RAD Studio 12.3 Community Edition. It runs without errors. After running dcc32.exe %ERRORLEVEL% = 0. What error do you get when you compile something with dcc32.exe from the Community Edition. Can't you catch this error and make you decision based on that? Share this post Link to post
dmitrybv 5 Posted 6 hours ago dcc32.exe does not generate any error. You can understand that something went wrong only at the end of the installation, when bpl packages are registered in the registry for IDE. dcc32.exe does not create bpl packages and then it is already clear. But I want to give the user information about the impossibility of installation before the installation process begins. Share this post Link to post
DelphiUdIT 244 Posted 6 hours ago 4 minutes ago, dmitrybv said: dcc32.exe does not generate any error. You can understand that something went wrong only at the end of the installation, when bpl packages are registered in the registry for IDE. dcc32.exe does not create bpl packages and then it is already clear. But I want to give the user information about the impossibility of installation before the installation process begins. Why don't you use this: 10 hours ago, Kazantsev Alexey said: Look at https://docwiki.embarcadero.com/RADStudio/Alexandria/en/IDE_Command_Line_Switches_and_Options for bds.exe /ProductInfo:SKU Share this post Link to post
dmitrybv 5 Posted 5 hours ago (edited) It seems that the solution with "bds.exe /ProductInfo:SKU" is suitable, but it does not work in the classic function of outputting the results of the StdOutput work via CreatePipe. Can you tell me how to correctly redirect the results passed to StdOutput to TMemo? I am trying to use the following code, but TMemo remains empty. At the same time, if you create a BdsGetSKU.Cmd file with the text C:\RADStudio\23.0\bin\bds.exe /ProductInfo:SKU and run it in cmd, the text "Enterprise" is output in cmd. procedure RunConsoleAppAndCaptureOutput(const ACommandLine, AWorkingDir: string; AMemo: TMemo); var SecurityAttr: TSecurityAttributes; ReadPipe, WritePipe: THandle; StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; Buffer: array[0..255] of AnsiChar; BytesRead: DWORD; AppRunning: DWORD; Output: TStringStream; CommandLineMutable: array[0..1023] of Char; begin AMemo.Clear; SecurityAttr.nLength := SizeOf(TSecurityAttributes); SecurityAttr.bInheritHandle := True; SecurityAttr.lpSecurityDescriptor := nil; if not CreatePipe(ReadPipe, WritePipe, @SecurityAttr, 0) then begin AMemo.Lines.Add('Failed to create channel.'); Exit; end; FillChar(StartupInfo, SizeOf(StartupInfo), 0); StartupInfo.cb := SizeOf(StartupInfo); StartupInfo.hStdOutput := WritePipe; StartupInfo.hStdError := WritePipe; StartupInfo.dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW; StartupInfo.wShowWindow := SW_HIDE; StrPLCopy(CommandLineMutable, ACommandLine, Length(ACommandLine) + 1); if not CreateProcess( nil, CommandLineMutable, nil, nil, True, 0, nil, PChar(AWorkingDir), // <- working directory StartupInfo, ProcessInfo ) then begin AMemo.Lines.Add('Failed to start process.'); CloseHandle(ReadPipe); CloseHandle(WritePipe); Exit; end; CloseHandle(WritePipe); Output := TStringStream.Create; try repeat BytesRead := 0; if ReadFile(ReadPipe, Buffer, SizeOf(Buffer) - 1, BytesRead, nil) and (BytesRead > 0) then begin Buffer[BytesRead] := #0; Output.WriteString(String(AnsiString(Buffer))); end; GetExitCodeProcess(ProcessInfo.hProcess, AppRunning); until AppRunning <> STILL_ACTIVE; // Read the rest while ReadFile(ReadPipe, Buffer, SizeOf(Buffer) - 1, BytesRead, nil) and (BytesRead > 0) do begin Buffer[BytesRead] := #0; Output.WriteString(String(AnsiString(Buffer))); end; AMemo.Lines.Text := Output.DataString; finally Output.Free; CloseHandle(ReadPipe); CloseHandle(ProcessInfo.hProcess); CloseHandle(ProcessInfo.hThread); end; end; procedure TForm1.Button1Click(Sender: TObject); begin // RunConsoleAppAndCaptureOutput(Edit1.Text, 'C:\RADStudio\23.0\bin', Memo1); // RunConsoleAppAndCaptureOutput('cmd /c dir', 'C:\Windows', Memo1); RunConsoleAppAndCaptureOutput('C:\RADStudio\23.0\bin\bds.exe /ProductInfo:SKU', 'C:\RADStudio\23.0\bin', Memo1); // RunConsoleAppAndCaptureOutput('C:\RADStudio\23.0\Projects\CommandLineInterpreter\BdsGetSKU.Cmd /ProductInfo:SKU', 'C:\RADStudio\23.0\bin', Memo1); end; Edited 5 hours ago by dmitrybv Share this post Link to post
Lars Fosdal 1858 Posted 5 hours ago @dmitrybv I assume that in your real code, you retrieve the correct installation paths from registry? Edit: Also, see this for executing shell commands: Share this post Link to post
dmitrybv 5 Posted 5 hours ago (edited) Yes, in a real application I use the registry branch Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\23.0 to get the value for the App parameter that stores the path to bds.exe I try to keep the demo code to a minimum so that it is clear what problem I am discussing here. Edited 5 hours ago by dmitrybv Share this post Link to post
rvk 46 Posted 5 hours ago Note that bds.exe /ProductInfo:SKU doesn't work in all version !! For me it prompts a popup dialog where I need to enter a license key (while I already have a licensed version installed). So I wouldn't trust prameters to bds.exe unless you determined those parameters are correct for all versions. You might have better luck just looking at the "Detail" properties of the bds.exe itself. Mine says "Product name: Professional" so I guess the community version would display "Community edition" or something. (I wonder how the Jedi project does this. I think they use one or the other depending on the version.) Share this post Link to post
dmitrybv 5 Posted 4 hours ago I tested RAD Studio 12.1 Community Edition. For this edition, the "Detail" properties of the bds.exe contain the value “Personal”. I don’t know what the value Personal means and whether it is related to the concept of Edition at all. Share this post Link to post
Uwe Raabe 2159 Posted 4 hours ago In terms of SKU, the Community Edition is in fact a Professional Edition. It is just the License restrictions that make it a CE. Share this post Link to post
rvk 46 Posted 4 hours ago 2 minutes ago, Uwe Raabe said: In terms of SKU, the Community Edition is in fact a Professional Edition. It is just the License restrictions that make it a CE. Wat does "Personal" mean in the details then for the Community edition? 11 minutes ago, dmitrybv said: I tested RAD Studio 12.1 Community Edition. For this edition, the "Detail" properties of the bds.exe contain the value “Personal”. I don’t know what the value Personal means and whether it is related to the concept of Edition at all. Share this post Link to post
Die Holländer 88 Posted 4 hours ago What does the professional edition say in the "Detail" properties of the bds.exe? Also “Personal”? (or Professional) Share this post Link to post
rvk 46 Posted 4 hours ago (edited) 2 minutes ago, Die Holländer said: What does the professional edition say in the "Detail" properties of the bds.exe? Also “Personal”? (or Professional) Delphi 10.2 Professional shows "Product name: Professional" and "Product version: 25.0". in the properties of bds.exe. Edited 4 hours ago by rvk Share this post Link to post