Version configuration options in Debug and Release mode in Delphi

Asked

Viewed 7,707 times

7

In projects in Delphi, we have the options Debug and Release in Build Configurations.

Modos Debug e Release

I know the way Debug is used to debug the application and generates a larger executable by adding reference points to the debugger.
The way Release no longer includes the reference points and generates a smaller executable, this version to be delivered to the customer.

Well, that’s what I already know so far.
What I need to know is if has to simplify version settings only?

All Configuration

Example: You can set the version settings in the options in All Configurations and shall be independent of build in the option Debug or Release I continue having the same version number on both?

Because that? In development I make ten times one build in the option Debug and with that, using the option to auto-increment the version, I have for example a version 1.0.1.10.
But when will I give the build in the option Release I have the number of version 1.0.1.1.

Therefore, I need to keep changing, matching version number etc.

1 answer

3


Simple answer: Not.

Not so simple answer: As far as I know, there is no way, the way you are trying to achieve the desired effect.
After all, if you are using auto increment in build, he is controlled by building, Therefore, only increments each time you run the build. This control was added exactly for this, to have a notion of how many times we build in debug for example, to finally get to a release, and, we don’t always want the client version to be populated by our tests.

But if it’s really interesting to use a controller only for all builds, all is not lost, exist forms to be able to control the version as it was done in previous versions. Make use of a. bat file, and this you can run every time you build, why not?


@ECHO OFF
SETLOCAL
setLocal EnableDelayedExpansion

SET _myVar=0
FOR /F %%G in (.svn\entries.) DO (
IF !_myVar! LSS 3 SET /A _myVar+=1 & SET _svn_dir_rev=%%G
)

ECHO 1 VERSIONINFO > aVersionInfo.rc
ECHO. FILEVERSION %1,%2,%3,%_svn_dir_rev%   >> aVersionInfo.rc
ECHO. PRODUCTVERSION 1   >> aVersionInfo.rc
ECHO. FILEOS VOS__WINDOWS32   >> aVersionInfo.rc
ECHO. FILETYPE VFT_APP   >> aVersionInfo.rc
ECHO. BEGIN   >> aVersionInfo.rc
ECHO.   BLOCK "StringFileInfo"   >> aVersionInfo.rc
ECHO.   BEGIN   >> aVersionInfo.rc
ECHO.     BLOCK "080904b0"   >> aVersionInfo.rc
ECHO.     BEGIN   >> aVersionInfo.rc
ECHO.       VALUE "CompanyName","COMPANY\000"   >> aVersionInfo.rc
ECHO.       VALUE "FileDescription","APP\000"   >> aVersionInfo.rc
ECHO.       VALUE "FileVersion","%1.%2.%3.%_svn_dir_rev%\000"   >> aVersionInfo.rc
ECHO.       VALUE "InternalName","APP\000"   >> aVersionInfo.rc
ECHO.       VALUE "LegalCopyright","Copyright APP\000"   >> aVersionInfo.rc
ECHO.       VALUE "LegalTrademarks","APP\000"   >> aVersionInfo.rc
ECHO.       VALUE "OriginalFilename","APP.exe\000"   >> aVersionInfo.rc
ECHO.       VALUE "ProductName","APP\000"   >> aVersionInfo.rc
ECHO.       VALUE "ProductVersion,"1\000"   >> aVersionInfo.rc
ECHO.       VALUE "Comments","Compiled on %date% by %username%\000"   >> aVersionInfo.rc
ECHO.     END   >> aVersionInfo.rc
ECHO.   END   >> aVersionInfo.rc
ECHO.   BLOCK "VarFileInfo"   >> aVersionInfo.rc
ECHO.   BEGIN   >> aVersionInfo.rc
ECHO.     VALUE "Translation", 0x0809 1200   >> aVersionInfo.rc
ECHO.   END   >> aVersionInfo.rc
ECHO. END   >> aVersionInfo.rc
ENDLOCAL
  • 2

    The feature replaces Delphi’s version control, and where are you trying to compile? Took a look at the threads I Linkei in response?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.