lazarus built exe can't work on another windows 11 host lazarus / 34-Windows ---------------------------------------------------------------------- edinhui · 2026-04-24 13:55 Hi all I met a problem with built binary. I developed a serial tool with lazarus ide 4.4 on windows and I finished the development and built a exe file and upload to github release. but when I downloaded the binary exe file in another windows 11 host and double clicked it, it didn't work and didn't show any GUI interface. and I checked the windows event information, I can find some information below, is there any clue for this issue? ========================================================= Faulting application name: lzcom.exe, version: 0.0.0.0, time stamp: 0x00000000 Faulting module name: lzcom.exe, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x000000000011670c Faulting process id: 0x0xA7C Faulting application start time: 0x0x1DCD3C73FC96CB1 Faulting application path: c:\users\z004ejux\downloads\lzcom.exe Faulting module path: c:\users\z004ejux\downloads\lzcom.exe Report Id: 15f58528-9914-44be-aedc-3496ad549fbd Faulting package full name: Faulting package-relative application ID: ---------------------------------------------------------------------- Thaddy · 2026-04-24 14:23 What is important: did you compile your lzcom application with CPU specific or FPU specific settings? And can the other Windows machine support these instruction sets? Because if you compile with the default settings it will always work, unless there are restrictions on the admin level: then you have to make a rule for your program in the firewall settings. From what I see, though: likely an unsupported cpu/fpu instruction set. (or a damaged transfer) ---------------------------------------------------------------------- Martin_fr · 2026-04-24 14:30 Lets just add: I should indeed work... Even if you did build on a Win 10 or older system. But, first of all, up/download could go wrong and corrupt a file. Ensure you have an identical file: there are tools to calculate checksums (powershell or upload to virustotal) Also, it should work, that applies to the parts that come with the default install. If you added any 3rd party stuff, or made your own API calls to something... That can change things. You mentioned "serial tool" (serial port?) ---------------------------------------------------------------------- Martin_fr · 2026-04-24 14:32 And, also usage of any decent search engine will help you understand the error code (at least the likely meaning) https://learn.microsoft.com/en-us/windows/win32/debug/system-error- codes--0-499- Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ERROR_ACCESS_DENIED 5 (0x5) Access is denied. ---------------------------------------------------------------------- 440bx · 2026-04-24 14:52 Note that his error is: Exception code: 0xc0000005 which is an access violation, not the same as an access denied. ---------------------------------------------------------------------- LeP · 2026-04-24 15:10 If nothing is displayed, it's typically because an error occurred during the "creation" and initialization of the components/environment. In particular, check that your UNITS (or any third-party units) in the INITIALIZATION section don't contain any calls to something that doesn't exist, such as serial interfaces hardware. For example, very often an enumeration (list) is expected, but it might be empty, which causes the error if accessed. ---------------------------------------------------------------------- Fred vS · 2026-04-24 16:42 Hello. Did you check the windows 11 version of both system? Last Windows 11 version 25H2 has much restriction if trying to access the system. For example, using PTC, the binary is blocked to run if Windows 11 version >= 25H2 but works perfectly on previous windows 11 versions. See https://forum.lazarus.freepascal.org/index.php/topic,73856.0.html ---------------------------------------------------------------------- Ten_Mile_Hike · 2026-04-24 19:32 I am the least knowledgeable person here, so take my suggestion with a grain of salt... Could Defender or your AV be preventing access to hardware or software??? ---------------------------------------------------------------------- LeP · 2026-04-24 20:01 Quote from: Fred vS on April 24, 2026, 06:42:52 pmLast Windows 11 version 25H2 has much restriction if trying to access the system. For example, using PTC, the binary is blocked to run if Windows 11 version >= 25H2 but works perfectly on previous windows 11 versions. See https://forum.lazarus.freepascal.org/index.php/topic,73856.0.html I reply in the suggested thread about your observation. ---------------------------------------------------------------------- Thaddy · 2026-04-25 07:14 The windows "observation" is wrong, at least for 64 bit. It may be that the legacy 32 bit has gotten more protections, because 32 bit drivers are often not maintained well enough. ---------------------------------------------------------------------- edinhui · 2026-04-26 08:27 Hi all I just try to install the lazarus on the host which problem happened, and I want build the application on that host to see what will happen. and I found that even lazarus itself can't work. similar problem with my application. the host is windows 11 enterprise edition 23H2 OS build: 22631.6783 Windows Feature Experience Pack 1000.22700.1108.0 Faulting application name: lazarus.exe, version: 4.6.0.0, time stamp: 0x00000000 Faulting module name: lazarus.exe, version: 4.6.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x000000000019ee46 Faulting process id: 0x0x6C78 Faulting application start time: 0x0x1DCD5545FC5AA6A Faulting application path: C:\Data\software\lazarus\lazarus.exe Faulting module path: C:\Data\software\lazarus\lazarus.exe Report Id: e75a0d54-137d-4862-999d-8078f76960b9 Faulting package full name: Faulting package-relative application ID: ---------------------------------------------------------------------- dbannon · 2026-04-26 10:37 Quote from: edinhui on April 26, 2026, 10:27:16 amHi all I just try to install the lazarus on the host which problem happened, and I want build the application on that host to see what will happen. and I found that even lazarus itself can't work. similar problem with my application. Another suggestion from a total not Windows user. This is not ARM hardware is it ? Although I'd expect it to be handled better than that ... Davo ---------------------------------------------------------------------- edinhui · 2026-04-26 13:26 the host is thinkpad x13 Gen5 intel, the CPU is intel Core ultra 5 ---------------------------------------------------------------------- Martin_fr · 2026-04-26 14:37 Maybe some Windows protection settings (ASLR, or other? / I don't actually know if any of them would be a problem, would not expect it, but never mind...). If it is a company PC, some policy settings... But they should give a proper error not a crash. ---------------------------------------------------------------------- LeP · 2026-04-26 16:45 Quote from: Martin_fr on April 26, 2026, 04:37:37 pmMaybe some Windows protection settings (ASLR, or other? / I don't actually know if any of them would be a problem, would not expect it, but never mind...). If it is a company PC, some policy settings... But they should give a proper error not a crash. Windows is not the issue. Like another similar topic ... is not Windows. There is no problem about any settings with new (I mean since 10 years) applications. ASLR should be compatible with all application. Windows can forces ASLR or  ALSR+ASLR HIGHENTROPY by Policies Group (single PC or Enterpise correlated) and this can break very old applications. Hope that everything in Lazarus / FPC is compiled with those flag sets, and compiler and linker are compatible with those. Correleated most used flags (not in Pascal notation) are: /DYNAMICBASE (ASLR Address space layout randomization) -> PE OPT FLAGS = $40; /HEVA (ASLR HIGH ENTROPY) -> PE OPT FLAGS = $20; /NX (DEP Data Execution Prevent) -> PE OPT FLAGS = $100; /CFG (CFG Control Flow Guard) ->  PE OPT FLAGS = $4000 (CFG works only with compiler support and linker, otherwise is not meaning); All those are for 64 bit application (although some of these can also be applied to 32-bit applications) ---------------------------------------------------------------------- marcov · 2026-04-26 21:10 Since it is in a download dir, see if it needs an "unblock"?  Move out of a virtual folder to  a normal new folder ? ---------------------------------------------------------------------- edinhui · 2026-04-27 14:02 I tried to see if it is caused by the DEP of windows 11, and found it is NOT on the working host. whichi means on the host which is working, when I change the DEP, always working, for lazarus or my develped app. while on the host which is not working, bitlocker prevent me to change it. ---------------------------------------------------------------------- LeP · 2026-04-27 14:15 Try to click with a right mouse button on the Lazarus.exe file. Goto "Properties/Compatibility" and choose "Run resolution instrument ...." (I don't remember the precise titles and words ...) May be this give you a street ... ---------------------------------------------------------------------- Boleeman · 2026-04-28 01:35 There is also a multiple file unblocker written in CSharp at https://www.csharphelper.com/howtos/howto_unblock_files.html Or perhaps for a single file go into File Properties, Security at the bottom, Check UnBlock, ...  (as shown in the attached png file) ---------------------------------------------------------------------- edinhui · 2026-04-30 06:54 I think maybe the root cause is the DGService which is part of the data security services, it seems will inject some code into the process and this will cause the lazarus and app developed by lazarus crash. ================================== Running  DGService          Usage History Monitor ================================== dgapi64.dll is a dynamic link library (DLL) file associated with Digital Guardian, a data loss prevention (DLP) software. This DLL is typically located in the C:\Windows\System32 directory and is used by Digital Guardian to monitor and protect sensitive data on endpoints. It plays a critical role in the software's functionality by integrating with system processes to enforce security policies. Common Issues with dgapi64.dll Performance Problems: When Digital Guardian is installed alongside certain software, such as Endpoint Privilege Manager (EPM), users may experience performance issues. For example, processes like explorer.exe or cmd.exe may take longer to open. This occurs because Digital Guardian injects its DLLs, including dgapi64.dll, into system processes, which can conflict with EPM's "Anti-Tampering Protection" settings. Crashes: dgapi64.dll has been reported in crash logs for processes like RAServer.exe. These crashes often involve access violations (exception code c0000005), indicating that the DLL attempted to access restricted memory. - EventData   AppName lazarus.exe   AppVersion 4.4.0.0   AppTimeStamp 00000000   ModuleName dgapi64.dll   ModuleVersion 11.0.0.92   ModuleTimeStamp 69614987   ExceptionCode c0000005   FaultingOffset 000000000003efbc   ProcessId 0x4de4   ProcessCreationTime 0x1dcd86a483e601c   AppPath C:\devtools\lazarus\lazarus.exe   ModulePath c:\windows\system32\dgapi64.dll   IntegratorReportId c932e83c-8ce7-4ed5-82f5-8fcedc44921c   PackageFullName    PackageRelativeAppId ---------------------------------------------------------------------- marcov · 2026-04-30 12:00 Quote from: Boleeman on April 28, 2026, 03:35:43 amThere is also a multiple file unblocker written in CSharp at https://www.csharphelper.com/howtos/howto_unblock_files.html A commandline mass unblocker is delivered with FPC:   "chmls unblock " ---------------------------------------------------------------------- Boleeman · 2026-05-01 11:31 Thanks Marcov for that info:  A commandline mass unblocker is delivered with FPC:   "chmls unblock " I was going to try to convert that CSharp code. I did a search on Google but it came up with: chmls is a command-line utility used within the Lazarus IDE ecosystem to manage and interact with Compiled Help Module (.chm) files. ---------------------------------------------------------------------- marcov · 2026-05-01 15:23 That's true, but since CHMs also can get blocked after a download it also has the unblock feature integrated. ---------------------------------------------------------------------- Thaddy · 2026-05-02 14:03 And you can factor that out too. ---------------------------------------------------------------------- marcov · 2026-05-02 15:17 Quote from: Thaddy on May 02, 2026, 04:03:28 pmAnd you can factor that out too. Chmls unblock works with any file, or isn't that your worry? ---------------------------------------------------------------------- Thaddy · 2026-05-02 16:01 No, just noticed that if you want a separate executable with the same unlock logic you can factor it out. There's also a similar unlock unit by Bart from many moons ago. ---------------------------------------------------------------------- jcmontherock · 2026-05-02 16:25 I see also another point: execution of an application depends of the screen definition of each station. I have a desktop with a big screen with a DesignTimePPI of 163. I cannot run it on my laptop which has a Dpi of 120. I should recompile it on the laptop to have a right view of forms. ---------------------------------------------------------------------- marcov · 2026-05-02 19:21 Quote from: Thaddy on May 02, 2026, 06:01:46 pmNo, just noticed that if you want a separate executable with the same unlock logic you can factor it out. You mean like winutils.UnBlockFile ? It has been there for over an decade......