Release configuration options in Debug and Release mode in Delphi

7

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

IknowthatDebugmodeisusedtodebugtheapplicationandthatitgeneratesalargerexecutablebyaddingcuepointstothedebugger.Releasemodenolongerincludesdatumsandgeneratesasmallerexecutable,versiontobedeliveredtotheclient.

Well,that'swhatIalreadyknowsofar.WhatIneedtoknowisifhowtosimplifyversionsettingsonly?

Example : You can set the version settings for the options in All Configurations and regardless of build option Debug Debug both?

Debug Debugging Debugging strong> and with that, using the option to autoincrement the version, I have for example a version 1.0.1.10 . But when I give build the Release option I have the version 1.0.1.1 .

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

    
asked by anonymous 07.05.2014 / 21:38

1 answer

3

Simple answer: No .

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're using auto increment in build , it's controlled by build , so it only increments each time you build. This control has been added exactly for this, we have a notion of how many times we have built in debug for example, to finally arrive at a release, and, we do not always want the client version to be populated by our tests.

But if you really want to use one control for all builds, not everything is 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 one 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
@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%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "FileDescription","APP%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "FileVersion","%1.%2.%3.%_svn_dir_rev%%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "InternalName","APP%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "LegalCopyright","Copyright APP%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "LegalTrademarks","APP%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "OriginalFilename","APP.exe%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "ProductName","APP%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "ProductVersion,"1%pre%0"   >> aVersionInfo.rc
ECHO.       VALUE "Comments","Compiled on %date% by %username%%pre%0"   >> 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
0" >> aVersionInfo.rc ECHO. VALUE "FileDescription","APP%pre%0" >> aVersionInfo.rc ECHO. VALUE "FileVersion","%1.%2.%3.%_svn_dir_rev%%pre%0" >> aVersionInfo.rc ECHO. VALUE "InternalName","APP%pre%0" >> aVersionInfo.rc ECHO. VALUE "LegalCopyright","Copyright APP%pre%0" >> aVersionInfo.rc ECHO. VALUE "LegalTrademarks","APP%pre%0" >> aVersionInfo.rc ECHO. VALUE "OriginalFilename","APP.exe%pre%0" >> aVersionInfo.rc ECHO. VALUE "ProductName","APP%pre%0" >> aVersionInfo.rc ECHO. VALUE "ProductVersion,"1%pre%0" >> aVersionInfo.rc ECHO. VALUE "Comments","Compiled on %date% by %username%%pre%0" >> 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
    
07.05.2014 / 22:31