VSoft Technologies BlogsVSoft Technologies Blogs - posts about our products and software development.https://www.finalbuilder.com/resources/blogsManaging Delphi Version Info with FinalBuilderhttps://www.finalbuilder.com/resources/blogs/postid/836/managing-delphi-version-info-with-finalbuilderDelphi,FinalBuilder,WindowsWed, 26 Jun 2019 15:49:26 GMT<p>In this post, we'll take a look at the various options for managing and updating Version Info in Delphi projects using FinalBuilder.</p> <h2>Windows Version Info Primer</h2> <p>Windows Version Info (ie the version info shown in explorer) is stored in a <a href="https://docs.microsoft.com/en-us/windows/desktop/menurc/versioninfo-resource" target="_blank">VERSIONINFO</a> resource inside the executable (exe or dll). These resources are created by defining a .rc file, and compiling with either the windows resource compiler (rc.exe) or Delphi's provided resource compiler (brcc32 or cgrc depending on the delphi version). This results in a .res file, which can be linked into exe at compile time by referencing it in the source code, e.g :</p> <pre class="brush:delphi; toolbar:false;"> {$R 'myresource.res'}</pre> <p>I highly recommend familiarising yourself with the VERSIONINFO resource type and it's parts.</p> <h2>Delphi IDE Support for Version Info</h2> <p>The Delphi IDE creates a [YourProjectName].res file next to the dpr or dpk when you create a new project. This is where the IDE will place the VERSIONINFO resource when you enable the option to "Include version information in project".  When you compile the project in the IDE, if needed the IDE will regenerate this res file with updated version info before it is linked into the executable.  For exe's, this resource file also includes the MAINICON resource (the icon shown in explorer).</p> <p>You do not have to use this feature, you can leave the option turned off and manage the version info yourself, by creating your own resource script (.rc) with a VERSIONINFO structure,  and compiling it and referencing the resulting .res file in your source code. You can even just reference the .rc file</p> <pre class="brush:delphi; toolbar:false;"> {$R 'myresource.res' 'myresource.rc'}</pre> <p>and the IDE will compile the rc file and link in the resulting res file. The caveat to this technique is that the command line compiler (dcc32, dcc64 etc) does not support this. </p> <p>If your binary doesn't have version info, or has incorrect version info, it's typically because :</p> <p>1) The version info  resource wasn't referenced in the source and wasn't linked in<br /> 2) There are duplicate VERSIONINFO resources linked, windows will pick the first one it finds.<br /> 3) You set the version info on the wrong IDE configuration (more on this below). </p> <p>The Delphi IDE, along with the dproj file (which is an msbuild project file), uses a convoluted configuration inheritance mechanism to set project properties, including version info. Many a developer has been caught out by this scheme, setting the version info at the wrong node in the heirachy, resulting in no version info in their executables. There have also been issues with dproj files that have been upgraded through multiple versions of delphi over the years.</p> <h2>Using FinalBuilder</h2> <p>In the development environment, the version info usually doesn't matter too much, but for formal releases it's critical, so it's best to leave setting/updating your version info  to your <a href="/finalbuilder" target="_blank">automated build tool</a> or your <a href="/continua-ci" target="_blank">continuous integration server</a>. In FinalBuilder we have invested a lot of time and energy to making version info work correctly with all the different versions of delphi, dealing with the vagaries and subtle differences with each version (and there are many!).</p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/delphi-versioninfo-tab.png" /></p> <p>On the Delphi action in FinalBuilder, the Version Info tab presents the version info in a similar way to old versions of delphi IDE did (a much nice ui that the current version imho). This ui allows you control all the various version info properties (and there are a lot!). Note that these will only take effect if you have the "Regenerate resource" option checked on the Project tab (ie, regenerate yourproject.res). </p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/delphi-project-tab.png" /></p> <p>Note that the Major, Minor, Release and Build fields are number spin edits, and cannot take FinalBuilder variables. That can easily be worked around with some simple scripting, in the BeforeAction script event  (javascript):</p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/delphi-action-script.png" /></p> <p>Another option is to use <a href="https://wiki.finalbuilder.com/display/FB8/Property+Sets" target="_blank">Property Sets</a> to provide the source of the Version Info. Property sets are especially useful when you have multiple actions that need the same version info, or at least to share the same version numbers. Creating a Property Set is trivial, just drop a PropertySet Define action on your target, before the Delphi Action. In the PropertySet Define action, select Win32 Version Info to manage all version info properties, or Win32 Version Numbers to have the property set just manage the major, minor, release and build numbers.</p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/define-propertyset.png" /></p> <p>To set the property set values, add a PropertySet Assign Values action before the Delphi action.</p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/propset-assign.png" /></p> <p>Then in the Delphi action it's a simple task to select the property set in the version info tab</p> <p style="text-align: center;"><img src="/blogimages/vincent/fbversioninfo/delphi-use-propset.png" /></p> <p>Notice that the version number fields are disabled, since they are now provided by the property set. If you choose the Win32 Version Info property set type, more fields are disabled.</p> <p>One last thing I should mention, is that along with the Version Info and the MAINICON, the project.res file also typically (well for windows at least) contains the manifest file. I recommend you look at the Resource Compiler tab, where it lets you choose which resource compiler to use (more useful in older versions of delphi, where brcc32 didn't cope with some hicolor icon types) and specify the manifest file. I discussed <a href="/resources/blogs/windows-manifest-files" target="_blank">windows manifest files a few years ago in this blog post</a>.</p> 836Introducing Continua CI Version 1.9https://www.finalbuilder.com/resources/blogs/postid/782/introducing-continua-ci-version-19.NET,Continua CI,Delphi,General,Web Development,WindowsTue, 14 Aug 2018 13:47:08 GMT<p><img alt="" src="/blogimages/dave/ContinuaCIWizardImageSmall.png" style="border-width: 0px; border-style: solid; margin-right: 5px; margin-left: 5px; width: 55px; height: 55px;" /></p> <p>Version 1.9 is now out of beta and available as a stable release. Thank you to those of you who have already tried out the beta - especially those who reported issues.</p> <p>This version brings major changes to the notifications system. We redesigned it using a common architecture, that makes it much easier to add new notification publisher types. Where previously, only email, XMPP and private message notifications were available, there are now publishers for Slack, Teams, Hipchat and Stride. And we can now add more (let us know what you need).</p> <p><img alt="" src="/blogimages/dave/PublisherTypes.png" style="width: 626px; height: 399px; display: block; margin-left: auto; margin-right: auto; " /></p> <p>We are no longer limited to one publisher of each type. You may, for example, have different email servers for different teams on your company. You can set up two email publishers, one for each server, and set up subscriptions so that notifications from different projects go to different email servers. Likewise for different Slack workspaces, Teams channel connectors and so on.</p> <p>We have also improved the XMPP publisher to support sending notifications to rooms. Subscriptions have been improved, allowing you to specify a room and/or channel for this and other publishers.</p> <p><img alt="" src="/blogimages/dave/Subscription.png" style="display: block; margin-left: auto; margin-right: auto; width: 625px; height: 733px;" /></p> <p>User preferences have been updated allowing each user to specify a recipient id, username or channel per publisher.</p> <p><img alt="" src="/blogimages/dave/UserPreferences.png" style="width: 726px; height: 751px; display: block; margin-left: auto; margin-right: auto; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" /></p> <p>You can see some metrics on the throughput of each publisher (number of messages on queue, messages sent per second, average send time, etc.) on the Publishers page in the Administration area. This also shows real-time counts of any errors occurring while sending messages and also any messages waiting on a retry queue due to rate limiting or service outages. This allows you to know when you need to upgrade rate limits or make other service changes.</p> <p><img alt="" src="/blogimages/dave/PublisherMetrics.png" style="width: 990px; height: 306px; display: block; margin-left: auto; margin-right: auto; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" /></p> <p>The Templates page has been updated. Templates are now divided into a tab per publisher. The list of available variables for each event type has been moved to a expandable side panel.</p> <p><img alt="" src="/blogimages/dave/NotificationTemplates.png" style="width: 564px; height: 707px; display: block; margin-left: auto; margin-right: auto; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" /></p> <p>This release is built on .Net Framework version 4.7.2, which has allowed us to upgrade a number of third party libraries, including the database ORM and PostgreSQL drivers. This has noticeably improved performance, as well as providing us with a richer platform to build future features on. The setup wizard will prompt for you to install .Net Framework version 4.7.2, before continuing with the installation.</p> <p><img alt="" src="/blogimages/dave/InstallerFrameworkRequirement.PNG" style="width: 503px; height: 391px; display: block; margin-left: auto; margin-right: auto;" /></p> <p>Note that applications running on .Net 4.7.2 do not run on versions of Windows prior to Windows Server 2008R2 and Windows 7 SP1. We are also dropping the 32-bit server installer. This is mainly to reduce testing overheads. We will still be releasing 32-bit agents for those who are using 16-bit compilers.</p> <p>We will continue to provide bug fixes to Continua CI version 1.8.1 for while to give you time to migrate from older platforms.</p> <p> </p> <p> </p> 782Continua CI and TLS 1.2https://www.finalbuilder.com/resources/blogs/postid/761/continua-ci-and-tls-12.NET,Continua CI,Delphi,WindowsFri, 23 Feb 2018 09:24:09 GMT<p>SSL standards are changing, and older SSL/TSL protocols are slowly being deprecated, or even turned off by some services. This post shows how to enable TLS 1.2 support in Continua CI.</p> <p>Yesterday, we started getting reports that the Github Status event handler, and the Github Status action in Continua CI had stopped working.</p> <p>Sure enough, in our testing here we were able to confirm the case. While testing this under the debugger, the error we were seeing was rather strange : "The request was aborted: Could not create SSL/TLS secure channel.". </p> <p>After some research, we found this error was due to being unable to negotiate a common protocol between the client and the server.</p> <p>Now Continua CI 1.x is built with .NET 4.0 (v2 will be on 4.7.1) - we know that .NET 4.0 doesn't support TLS 1.2, and a quick check of the github api server using <a href="https://www.ssllabs.com/ssltest/" target="_blank">SSLLabs</a> shows that they now only support TLS 1.2.</p> <p style="text-align: center;"> <img alt="" src="/blogimages/vincent/continua-tls/github-ssllabs.png" width="987" height="279" /> </p> <br /> <p> I wondered if this was announced by github - turns out they did announce this 3 weeks ago :</p> <p> <a href="https://github.com/blog/2498-weak-cryptographic-standards-removal-notice" target="_blank">Weak cryptographic standards removal notice</a> </p> <p>and yesterday they permanently disabled TLS 1.0 and 1.1</p> <p> <a href="https://github.com/blog/2507-weak-cryptographic-standards-removed" target="_blank">Weak cryptographic standards removed</a> </p> <p>Anyway, back to Continua CI. The good news is that there is a way to enable TLS 1.2 support in Continua CI. Note that this only works when running on Windows Server 2008 or later (Server 2003 does not support TLS 1.2 at all, and we will be dropping support for it with v2).</p> <p>1) Install .Net Framework 4.5 or later - since all 4.x frameworks effectively replace 4.0 - 4.5 has support for TLS 1.2</p> <p>2) Edit %ProgramFiles%\VSoft Technologies\ContinuaCI\Server\Continua.Server.Service.exe.config on the server and %ProgramFiles%\VSoft Technologies\ContinuaCI Agent\Continua.Agent.Service.exe.config on each agent - add the following line in <strong>appSettings</strong> section :</p> <pre class="brush:xml; toolbar:false;"> &lt;add key="Continua.Service.SecurityProtocolType" value="Tls|Tls11|Tls12" /&gt; </pre> Note that the key supports the following values: Ssl2|Ssl3|Tls|Tls11|Tls12|Default<br /> <p> Default = Ssl3|Tls<br /> Multiple protocols can be separated with |<br /> The value "Tls|Tls11|Tls12" will allow Continua CI to work with services that do not support or have not enabled TLS 1.2, and with services that only support TLS 1.2 .</p> <p>3) Open Regedit and add the following value to : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 : SchUseStrongCrypto type DWORD value 1</p> <p>4) Restart the Server and Agent Services.</p> <p>5) You may need to restart your server(s) for the registry change to take effect.</p> <p>One last note : This change also effects the communication between the Continua CI Server and agents, if you make the change on the server, make sure you make a compatible change on the agents.</p>761Windows 10 Fall Creators Updatehttps://www.finalbuilder.com/resources/blogs/postid/756/windows-10-fall-creators-updateAutomise,Delphi,FinalBuilder,WindowsTue, 17 Oct 2017 09:55:38 GMTThe <a href="https://blogs.windows.com/windowsexperience/2017/10/17/get-windows-10-fall-creators-update" title="How do I get the Fall Update?">Windows 10 Fall Creators Update has only been out a few hours</a>, but we're already getting questions about it.&nbsp;<br /> <br /> In our limited testing, FinalBuilder 8 and Automise 5 run fine.<br /> <br /> I've only been running the Fall Update for a few hours, but so far I have not noticed any issues. The applications I use daily all run fine.&nbsp;<br /> <br /> The "Windows 10 Creators Update" (ie the one before the Fall Update - stupid release naming imho) <a href="https://quality.embarcadero.com/browse/RSP-17972" title="Embarcadero issue tracker. Requires registration/login to view.">broke the Delphi debugger</a> when using runtime packages. Aparently the issue was caused by a library loader optiimisation, not taking into account that dll's can have multiple import tables. I never did see a full explaination or acknowledgement of the problem from Microsoft. <br /> <br /> This only affected the debugger (all native code debuggers, not just Delphi), which would load and unload each dll many times (based on the number of imports, for FinalBuilder's core package, it was in the hundreds). Sometimes the application would launch, only for the debugger to crash, sometimes it would just hang, sometimes the Delphi IDE would get out of memory errors.&nbsp;<br /> <br /> For me, this was a big issue, since FinalBuilder and Automise use runtime packages. This affected all versions of Delphi, even the latest 10.2 (Tokyo). Embarcadero did eventually ship an update to 10.2 that mostly resolved the problem (not an easy thing as it involved major linker changes), but that didn't help us as we're using an older version (for reasons I won't go into here!). <br /> <br /> So since April 2017, I've been really hamstrung when it comes to debugging. Fortunately we discovered the issue before the Creators Update was installed on our other Delphi development machines (and it's a been a constant battle with windows update nagging to install it ever since) so we were still able debug, just not on my dev machine. Frustrating to say the least.&nbsp;<br /> <br /> The good news is that the Fall Update (mostly) fixes the problem.&nbsp; I still see some dlls/packages getting unloaded and reloaded again, but the application launches and I can debug.&nbsp;<br /> <br /> As far as windows functionality in the Fall Update goes, well the Task Manager has a new GPU section on the performance tab which is mildly interesting, but since I don't use a Pen, or wear a VR headset while working, I'm not noticing much to get excited about. Hopefully, it's just a lot of bug fixes and performance enhancements, minus the show stoppers!!&nbsp;756